function openNewWindow(newWindowURL)
{
	// Forces the current window to remain on top
	//window.open(newWindowURL,'').blur();
	//window.focus();
}

function setAllModelsCount()
{
	document.getElementById('categoryCountDiv').innerHTML="("+document.getElementById('AllModelsCountValue').value+")";
}

function setAllModelsCountNew()
{
	document.getElementById('categoryCountDiv').innerHTML="("+document.getElementById('AllModelsCountValue').value+")";
	document.getElementById('categoryTextCount').innerHTML="("+document.getElementById('AllModelsCountValue').value+")";	
}


function onMouseHoverCat(divId)
{
document.getElementById(divId).className="subCatOnMouseOver";
}


function onMouseOutCat(divId)
{
document.getElementById(divId).className="subCatOnMouseOut";
}



function arrowOver(divId)
{
document.getElementById(divId).className="shapeOver";
}


function arrowOut(divId)
{
document.getElementById(divId).className="shapeOut";
}


function displaySubCategoryBlock()
{
document.getElementById('subCategoryBoxLayer').style.display="block";
}

function hideSubCategoryBlock()
{
document.getElementById('subCategoryBoxLayer').style.display="none";
}

function setTabWidth(divId,source,whitelabel)
{
var width=parseInt(document.getElementById(source).offsetWidth+10);	 
var labelwidth=parseInt(document.getElementById(source).offsetWidth+8);	
document.getElementById(divId).style.width=width+"px"; 	
document.getElementById(whitelabel).style.width=labelwidth+"px"; 	
}

function setTabWidthNew(divId,source,whitelabel)
{

var width=parseInt(document.getElementById(source).offsetWidth+10);	 
var labelwidth=parseInt(document.getElementById(source).offsetWidth+8);	
document.getElementById(divId).style.width=width+"px"; 	
document.getElementById(whitelabel).style.width=labelwidth+"px"; 	

	if(divId=="liveGirlsTab")
	{
	var catwidth=parseInt(document.getElementById("categoryText").offsetWidth);	
	document.getElementById("liveGirlsTab").style.width=catwidth+"px";
	var catLabel=parseInt(catwidth-2);
	document.getElementById("girlsWhiteLabel").style.width=catLabel+"px"; 			
	}

}

function goThere(value){
	var linkList=value
	if(linkList!=""){document.location.href=linkList;}
}


function displayRandomOption()
{
	document.getElementById('randomMainDiv').style.display="block";	
}

function setDivBackground(id)
{
	document.getElementById(id).style.background="#EEEEEE";	
}

function unsetDivBackground(id)
{
	document.getElementById(id).style.background="#ffffff";	
}

function hideRandomOption()
{
		document.getElementById('randomMainDiv').style.display="none";			
}


function getConfirmationObjects()
{
	var margin=parseInt(document.body.clientWidth-960);
	var leftmargin=parseInt(margin/2);
	this.margin=margin;
	this.leftmargin=leftmargin;
	this.bodywidth=document.body.clientWidth;
	return this;
}

function setConfirmationLayer()
{
	var objConfirmation=getConfirmationObjects();
	var middleString=document.getElementById('displayString').value;
	var string="<div id='emailConfirmationOverlay' style='width:"+objConfirmation.bodywidth+"px; margin-left:-"+objConfirmation.leftmargin+"px'>"+middleString+"</div>";
	document.getElementById("emailConfirmationLayer").innerHTML=string;
}

function confirmEmail()
{	
	/*
    document.getElementById('confirmYourEmail').style.display="none";
    document.getElementById('confirmErrorBlock').style.display="none";
    document.getElementById('confirmWaitBlock').style.display="block";
    */
	
	var objConfirmation=getConfirmationObjects();
	var middleString=document.getElementById('confirmWaitBlock').value;	
	var string="<div id='emailConfirmationOverlay' style='width:"+objConfirmation.bodywidth+"px; margin-left:-"+objConfirmation.leftmargin+"px'>"+middleString+"</div>";	
	document.getElementById("emailConfirmationLayer").innerHTML=string;
	
    var url =document.getElementById('hidConfirmEmailPage').value;
    var pars = '';    
    var myAjax = new Ajax.Request
    (
        url, 
        {
            method:'get', 
            parameters: pars, 
            onComplete: showConfirmEmailResponse      
        }
    );

}

function showConfirmEmailResponse(originalRequest)
{
	var objConfirmation=getConfirmationObjects();
    var response=originalRequest.responseText;
    //document.getElementById('confirmWaitBlock').style.display="none"; 
	
if(response=="success")
{
	
var middleString=document.getElementById('confirmEmailSent').value;		
var string="<div id='emailConfirmationOverlay' style='width:"+objConfirmation.bodywidth+"px; margin-left:-"+objConfirmation.leftmargin+"px'>"+middleString+"</div>";			
document.getElementById("emailConfirmationLayer").innerHTML=string;		
        //document.getElementById('confirmEmailSent').style.display="block";
setTimeout("hideConfirmationDiv()", 2000);
}
else
{
var middleString=document.getElementById('confirmErrorBlock').value;		
var string="<div id='emailConfirmationOverlay' style='width:"+objConfirmation.bodywidth+"px; margin-left:-"+objConfirmation.leftmargin+"px'>"+middleString+"</div>";			
document.getElementById("emailConfirmationLayer").innerHTML=string;	
        //document.getElementById('confirmErrorBlock').style.display="block"; 
}

}


function hideConfirmationDiv()
{
	document.getElementById("emailConfirmationMain").style.display="none";	
}