function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}


function getSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    if(window.scrollbars.visible==true)
		myWidth -= 16;          

    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
 return [myWidth, myHeight];
}

function getElement(element_id)
    {
    return document.getElementById(element_id);
    }

function createRequestObject() 
{
	if (window.ActiveXObject && !window.XMLHttpRequest) 
	{
		try {
			return new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {
			return;
		}
	}
	if (!window.ActiveXObject && window.XMLHttpRequest) {
		return new XMLHttpRequest();
	}
}

var http = createRequestObject();
var actualDiv = new String();
var startDiv = new String();
var UrlLink = new String();
var mail = new String();
var body = new String();
var orincode = new String();
var confirm_code = 'abcde';



var sw = screen.width;
var sh = screen.height;
var sp=true;
var popup;
var SdeltaWH = 1; 
var deltaWH = 10;
var SOffset = 1;
var ShowSpeed = 10;
var HideSpeed = 5;
var timer = null;
var top = 0;
var wait_for_continue = true;
var waiting = false;
var tooltip_id = "show_mail";





function getEventPosition(event)
	{
	var pos = new Array();
	
	if(document.all) // ie
	{
	pos['x'] = event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft);
	pos['y'] = event.clientY + (document.documentElement.scrollTop || document.body.scrollTop);
	}
	else // gecko
	{
	pos['x'] = event.pageX; 		
	pos['y'] = event.pageY;
	}
	return pos;
	}


function ShowBox()
{
var Box = getElement('box_co');
Size = getSize();
getXY = getScrollXY();

//alert(document.documentElement.offsetHeight);
Box.style.width = (Size[0]) + 'px';
Box.style.height = document.documentElement.offsetHeight + 'px';
Box.style.height = (Size[1]+getXY[1]) + 'px';
Box.style.display = '';
//Box.style.top = (getXY[1]) + 'px';


}

function ShowBoxPhoto()
{
var Box = getElement('box_co_photo');
Size = getSize();
getXY = getScrollXY();

//alert(document.documentElement.offsetHeight);
Box.style.width = (Size[0]) + 'px';
Box.style.height = document.documentElement.offsetHeight + 'px';
Box.style.height = (Size[1]+getXY[1]) + 'px';
Box.style.display = '';
//Box.style.top = (getXY[1]) + 'px';
}



var ScrollObj;
function ScrollAction()
{

if(ScrollObj)
{
	Size = getSize();
	getXY = getScrollXY();
	var x = (Size[0]/2)- 300; 
	var y = /*(Size[1]/2)- 200 +*/getXY[1] + 30;
	ScrollObj.style.top = y + 'px';
	ScrollObj.style.left = x + 'px';
	var Box = getElement('box_co');
	Box.style.top = (y - 50) + 'px';

}

}




function CloseAction()
{

if(ScrollObj)
{
var Box = getElement('box_co');
ScrollObj.style.display = 'none';
Box.style.display = 'none';
}

}






function ClickAction()
{ 

ShowBox();
Size = getSize();
getXY = getScrollXY();
var x = (Size[0]/2)- 300; 
var y = /*(Size[1]/2)- 200 +*/getXY[1] + 30;


var Forma = getElement('create_user_popup');
ScrollObj = Forma;
Forma.style.top = y + 'px';
Forma.style.left = x + 'px';
Forma.style.display = '';
	
}


function ClickActionReminder()
{ 

ShowBox();
Size = getSize();
getXY = getScrollXY();
var x = (Size[0]/2)- 200; 
var y = /*(Size[1]/2)- 200 +*/getXY[1] + 50;

var Forma = getElement('reminder_password');
ScrollObj = Forma;
Forma.style.top = y + 'px';
Forma.style.left = x + 'px';
Forma.style.display = '';
	
}

function ClickActionGenerate()
{ 
ShowBox();
Size = getSize();
getXY = getScrollXY();
var x = (Size[0]/2)- 200; 
var y = /*(Size[1]/2)- 200 +*/getXY[1] + 50;

var Forma = getElement('generate_password');
ScrollObj = Forma;
Forma.style.top = y+'px';
Forma.style.left = x + 'px';
Forma.style.display = '';
	
}



function OnResizeEx()
{
	
var Box = getElement('box_co');
if(Box)
if(Box.style.display != 'none')
{
	ClickAction();	
}
	
}


function ClickActionPromo()
{ 
ShowBox();
Size = getSize();
getXY = getScrollXY();
var x = (Size[0]/2)- 300; 
var y = /*(Size[1]/2)- 200 +*/getXY[1] + 5;

getElement('vPlayer_div').style.visibility = 'hidden';
var Forma = getElement('promo_popup_show');
ScrollObj = Forma;
Forma.style.top = y + 'px';
Forma.style.left = x + 'px';
Forma.style.display = '';
	
}


function ClickActionPreview()
{ 
ShowBox();
Size = getSize();
getXY = getScrollXY();
var x = (Size[0]/2)- 490; 
var y = /*(Size[1]/2)- 200 +*/getXY[1] + 30;

//getElement('vPlayer_div').style.visibility = 'hidden';
var Forma = getElement('preview_popup');
ScrollObj = Forma;
Forma.style.top = y + 'px';
Forma.style.left = x + 'px';
Forma.style.display = '';
	
}


window.onresize = OnResizeEx;
window.onscroll = OnResizeEx;