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 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 setLevel(size,flag,favcount,rowscount)
{
var confirmEmailHeight=0;
var showModelsHeight=0;
var RecommendedModels=0;

if(document.getElementById('confirmEmail')!=null)
{
var confirmEmailHeight=parseInt(document.getElementById('confirmEmail').offsetHeight+10);	
}

if(document.getElementById('ShowModels')!=null)
{
var showModelsHeight=parseInt(document.getElementById('ShowModels').offsetHeight);	
}

if(document.getElementById('RecommendedModels')!=null)
{
var RecommendedModels=parseInt(document.getElementById('RecommendedModels').offsetHeight);	
}

divRightHeight=parseInt(confirmEmailHeight+showModelsHeight+RecommendedModels);


var topRatedModelsHeight=parseInt(document.getElementById('specialContainer').offsetHeight+document.getElementById('camCategoriesBlock').offsetHeight+divRightHeight);
 
if(flag=="")
{
var privateDivHeight=parseInt(document.getElementById('containerNLeft').offsetHeight);
privateDivHeight=privateDivHeight-parseInt(document.getElementById('NewFaces').offsetHeight+topRatedModelsHeight);

	if(size<=40)
	{
	var privateDivHeight=parseInt(privateDivHeight+24);
	var containerLeftHeight=parseInt(document.getElementById('containerNLeft').offsetHeight);
	}
	else
	{
	var privateDivHeight=parseInt(privateDivHeight-1);
	var containerLeftHeight=parseInt(document.getElementById('containerNLeft').offsetHeight-25);
	}
}
else
{
var privateDivHeight=parseInt(document.getElementById('containerNLeft').offsetHeight-document.getElementById('favoriteOnlineBlock').offsetHeight);
privateDivHeight=privateDivHeight-parseInt(document.getElementById('NewFaces').offsetHeight+topRatedModelsHeight);


if(favcount==0)
{
	if(size>40)
	{
		var privateDivHeight=parseInt(privateDivHeight+20);
		var containerLeftHeight=parseInt(document.getElementById('containerNLeft').offsetHeight-5);
	}
	else
	{
		var privateDivHeight=parseInt(privateDivHeight+24);
		var containerLeftHeight=parseInt(document.getElementById('containerNLeft').offsetHeight);		
	}
}
else
{
	if(size<=40)
	{
		if(rowscount==1)
		{
		var privateDivHeight=parseInt(privateDivHeight+24);
		var containerLeftHeight=parseInt(document.getElementById('containerNLeft').offsetHeight);			
		}
		else
		{
		var privateDivHeight=parseInt(privateDivHeight-5);
		
		var containerLeftHeight=parseInt(document.getElementById('containerNLeft').offsetHeight);
		}
	}
	else
	{	
	
		if(rowscount==1)
		{
		var privateDivHeight=parseInt(privateDivHeight+1);
		var containerLeftHeight=parseInt(document.getElementById('containerNLeft').offsetHeight-23);			
		}
		else
		{
		
		var privateDivHeight=parseInt(privateDivHeight-28);
		var containerLeftHeight=parseInt(document.getElementById('containerNLeft').offsetHeight-23);
		}
	
	}
}

}

var imagesDivHeight=parseInt((privateDivHeight-25)/80);

imagesDivHeight=(imagesDivHeight<=4)?imagesDivHeight:(imagesDivHeight);

imagesDivHeight=imagesDivHeight*80+25;

if(document.getElementById('welcomeHeightDiv')!=null){
document.getElementById('welcomeHeightDiv').style.height=imagesDivHeight+"px";
}

document.getElementById('welcomeHeight').style.height=privateDivHeight+"px";
document.getElementById('modelListBlock').style.height=containerLeftHeight+"px";


}


function confirmEmail()
{
    document.getElementById('confirmYourEmail').style.display="none";
    document.getElementById('confirmErrorBlock').style.display="none";
    document.getElementById('confirmWaitBlock').style.display="block";
    
    var url =document.getElementById('hidConfirmEmailPage').value;
    var pars = '';    
    var myAjax = new Ajax.Request
    (
        url, 
        {
            method:'get', 
            parameters: pars, 
            onComplete: showConfirmEmailResponse      
        }
    );
}

function showConfirmEmailResponse(originalRequest)
{
    var response=originalRequest.responseText;
    document.getElementById('confirmWaitBlock').style.display="none"; 
    if(response=="success")
    {
        document.getElementById('confirmEmailSent').style.display="block";  
    }
    else
    {
        document.getElementById('confirmErrorBlock').style.display="block"; 
    }
}

