﻿// JScript File
var productDetailsPanel=new Array();

function showhide(elementname)
{
    var link=showhide.arguments[1];
    
	var el = document.getElementById(elementname);
	if(el){
	    if (el.style.display == 'none')
	    {
		    el.style.display = 'block';		
	    }
	    else
	    {
		    el.style.display = 'none';		
	    }
	}
	
	if(link){
	    link= document.getElementById(link);
	    if(el && el.style.display=='block'){	    
	        link.innerHTML='Minimize';
	    }else{
	        link.innerHTML='More';
	    }
	}
}

function showThisPanel(panel,a){
    if(a)
    {
        hideUnderLine();
        showUnderLineToCurrentTab(a);
    }
    if(productDetailsPanel!=null && productDetailsPanel.length>0){
        for(i=0;i<productDetailsPanel.length;i++){
            var el = document.getElementById(productDetailsPanel[i]);
            if(panel!=productDetailsPanel[i]){
                el.style.display = 'none';	        
            }else{
                el.style.display = 'block';	
            }
        }
    }
}

function hideUnderLine()
{
    trs=document.getElementsByTagName("TR");
    for(i=0;i<trs.length;i++)
    {
        if(trs[i].className=="TabContainer")
        {
            for(j=0;j<trs[i].childNodes.length;j++)
            {
                td=trs[i].childNodes[j];
                if(td.tagName=="TD")
                {
                    td.childNodes[0].style.color="#fff";
                    //if(td.className=="trLeft")
                    //    td.childNodes[0].src="images/a_l_d.gif";
                    //if(td.className=="trMid")
			        //    td.style.backgroundImage="url(images/d_bg.gif)";
                    //if(td.className=="trRight") 
                    //    td.childNodes[0].src="images/a_r_d.gif";
                }
            }
        }
   }
}
function showUnderLineToCurrentTab(a)
{
    tr=a;
    while(tr.tagName!="TR")
    {
        tr=tr.parentNode;
    }
    for(i=0;i<tr.childNodes.length;i++)
    {
        td=tr.childNodes[i];
        if(td.tagName=="TD")
        {
            //if(td.className=="trLeft")
            //    td.childNodes[0].src="images/a_l.gif";
            if(td.className=="trMid")
            {
                td.style.backgroundImage="none";
                //td.style.backgroundColor="#c3d9ff";//"url(images/a_bg.gif)";
                td.childNodes[0].style.color="#000";
            }
            //if(td.className=="trRight") 
            //    td.childNodes[0].src="images/a_r.gif";
        }
    }
}
function printScreen()
{
window.print();
}
function getPageSize()
{
	if (window.innerHeight && window.scrollMaxY) 
	{  
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} 
	else if (document.body.scrollHeight > document.body.offsetHeight)
	{ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} 
	else 
	{ // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) 
	{  // all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} 
	else if (document.documentElement && document.documentElement.clientHeight) 
	{ // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} 
	else if (document.body) 
	{ // other Explorers
	windowWidth = document.body.clientWidth;
	windowHeight = document.body.clientHeight;
	}  
	var pageHeight, pageWidth;
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight)
	{
	pageHeight = windowHeight;
	} 
	else 
	{ 
	pageHeight = yScroll;
	}
	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth)
	{  
		pageWidth = windowWidth;
	} 
	else 
	{
		pageWidth = xScroll;
	}
	return {pageWidth: pageWidth ,pageHeight: pageHeight , windowWidth: windowWidth, windowHeight: windowHeight};	
}


