
function popupOpen2(popupUrl, popupName, popupWidth, popupHeight)
{
    var content = '<iframe id="frameTiny" src="' + popupUrl + '" width="100%" height="100%" scrolling="no" frameborder="no" marginwidth="0" marginheight="0"></iframe>';
    TINY.box.show(content, 0, popupWidth, popupHeight, 1, 0);        
}

function popupOpenContent(content, popupWidth, popupHeight)
{    
    TINY.box.show(content, 0, popupWidth, popupHeight, 0, 0);        
}



function sectionMouseOver(sec, color)
{
   sec.style.color = color;
}

function sectionMouseOut(sec)
{
	sec.style.color = "";
}


var picSelectedNum = 0;

function picOver(a, num)
{	
	if(picSelectedNum == num)
		return;
	var n=40; 
	var d = document.getElementById("divOver"+num);
	d.style.opacity=n/100;
	d.style.filter='alpha(opacity='+n+')';	
}

function picOut(a, num)
{
	if(picSelectedNum == num)
		return;
	
	var n=0; 
	var d = document.getElementById("divOver"+num);
	d.style.opacity=n/100;
	d.style.filter='alpha(opacity='+n+')';	
}


function showContent(section)
{			
	cntSendAjaxRequest(section);	
}



function cntSendAjaxRequest(section)
{
    //Initiate the XMLHttpRequest object   
    var xmlRequest = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("MSXML2.XMLHTTP");// Msxml2.DOMDocument.3.0
             
    if (xmlRequest == null)
    return;
	
	var ajSection;
	if(section.indexOf("?") > 0)
		ajSection = section + "&j=1"
	else	
		ajSection = section + "?j=1"
	        
    xmlRequest.open("GET", ajSection, true);        
    
    // Set charset
    xmlRequest.setRequestHeader("Content-Type", "text/html; charset=utf-8");
           
    //Setup the callback function    
    xmlRequest.onreadystatechange = function(){ try { if(cntHandleAjaxResponse) cntHandleAjaxResponse(xmlRequest, section); }catch(ex){} };
        
    //Send the Ajax request to the server with the POST data    
    xmlRequest.send("");
}

function cntHandleAjaxResponse(xmlhttp, section)
{
    if (xmlhttp.readyState === 4)  // the server response is complete
    {        
        //HTTP status codes between 200 and 300 are okay; 200 is the best        
        var statusCode = xmlhttp.status;
        
        if ((statusCode >= 200) && (statusCode < 300))		
        {        
            //Process the server response        	
            var response = xmlhttp.responseText;						
            document.getElementById("cntFrame").innerHTML = response;			
			//window.setTimeout('cntAjaxEvalScripts()', 1000);
			cntAjaxEvalScripts();
        }
        else
        {
            //Some error handling
        	cntProcessAjaxError(xmlhttp,statusCode, section);
        }
    }
}

function cntAjaxEvalScripts()
{	
	initMenus();
    initLightBoxes();	
	correctFrameImg();	
	trackPageGoogle();
	
	// Get all script sections and eval javascript			
	var xAjax = document.getElementById("cntFrame").getElementsByTagName("script");	
	for(iAjax1=0; iAjax1<xAjax.length; iAjax1++)
	{	
		if(xAjax[iAjax1].parentNode.id.indexOf("flash") == -1 || xAjax[iAjax1].parentNode.id == "flashMainMenu")
		{
			try
			{						
				//alert(iAjax1+":  "+xAjax[iAjax1].text);	
				eval(xAjax[iAjax1].text);
			}
			catch(excAjax) 
			{ 
				//alert(excAjax); 
			}
		}
	}

	
}

function cntProcessAjaxError(xmlhttp, statusCode, section)
{
   window.location.href = section;
}


