﻿
//$(document).ready
//(
//	function()
//	{
//	  
//	}
//);

function showProgress(p) 
{
    $('.windowVeloProgress').show();
    $('.windowVeloProgress').width(1001);
    $('.windowVeloProgress').height($(document).height());
    positionWindow.objW = 250;
    positionWindow.objP = document.getElementById($('.' + p).attr('id'));
	positionWindow.position();
}

function showWindow(w)
{   
    showVelo();
    positionWindow.objW = 740;
    positionWindow.objP = document.getElementById($('.' + w).attr('id'));
	positionWindow.position();    
    $('.' + w).css('zIndex', 1500);
}

function showVelo()
{
    $('.windowVelo').show();
    $('.windowVelo').width(1001);
    $('.windowVelo').height($(document).height());
    $('select').css('visibility', 'hidden');
}

function hideVelo()
{
    $('.windowVelo').hide();
    $('select').css('visibility', 'visible');
}

var positionWindow = 
{	
	objP : null,
	objH : null,
	objW : null,
	conW : 1000,
	correctH : 0, 
	sizeWinH : null,
	moveT : null, 
		
	position : function()
	{		
		if(positionWindow.objP)
		{
			if(document.documentElement && document.documentElement.clientHeight)
			{
				positionWindow.sizeWinH = document.documentElement.clientHeight;
			}
			else if(document.body && document.body.clientHeight)
			{
				positionWindow.sizeWinH = document.body.clientHeight;
			}
			else
			{
				positionWindow.sizeWinH = window.innerHeight; 
			}
			
			positionWindow.objH = positionWindow.objP.scrollHeight; 
			var siteT = (positionWindow.sizeWinH - positionWindow.objH)/2;
			var siteW = (positionWindow.conW - positionWindow.objW)/2;	
			positionWindow.moveT = ((document.body.scrollTop)?document.body.scrollTop:document.documentElement.scrollTop) + siteT; 
			positionWindow.objP.style.top = positionWindow.moveT - positionWindow.correctH + 'px'; 
			positionWindow.objP.style.left = siteW + 'px';  
		}
	}
};

window.onscroll = function(){ positionWindow.position(); };
window.onresize = function(){ positionWindow.position(); }; 
