﻿var intTimerProduct=0;
var intTimerOther=0;

function show(id) {
	var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {
			document.getElementById('smenu'+i).style.display='none';
		}
	}
	if (d) {
		d.style.display='block';
	}
}

function showMenu(strType) {
	
	clearMenuTimeout(strType);
	
	// Close Previous Type
	document.getElementById("divOther").style.display="none";
	document.getElementById("divProduct").style.display="none";
	
	// Open Selected
	document.getElementById("div"+strType).style.display="block";
}

function setMenuTimeout(strType, intPassTime) {
    
    if(!intPassTime) intPassTime=500;
    
    switch(strType.toUpperCase()) {
        
        case "PRODUCT":        
            intTimerProduct=window.setTimeout("closeMenus('"+strType+"');",intPassTime);
            break;           
            
        case "OTHER":        
            intTimerOther=window.setTimeout("closeMenus('"+strType+"');",intPassTime);
            break;     
    }
}

function clearMenuTimeout(strType) {
    
    switch(strType.toUpperCase()) {
        
        case "PRODUCT":        
            window.clearTimeout(intTimerProduct);
            break;           
            
        case "OTHER":        
            window.clearTimeout(intTimerOther);
            break;     
    }	
}

function closeMenus(strType) {
    
    switch(strType.toUpperCase()) {
        
        case "PRODUCT":        
            document.getElementById("divProduct").style.display="none";
            intTimerProduct=0;
            break;           
            
        case "OTHER":        
            document.getElementById("divOther").style.display="none";
            intTimerOther=0;
            break;     
    }	
}

function toggleSection(strID) {
						
	var obj = document.getElementById(strID);
	var objIcon = document.getElementById(strID+"Icon");
						
	if(obj.style.display=='none'){
		obj.style.display='block';
		objIcon.src='../../framework/img/general/mnu_minus.gif';
	} 
	else {
		obj.style.display='none';
		objIcon.src='../../framework/img/general/mnu_plus.gif';
	}
}

function hideShow(strID)
{

    var obj = document.getElementById(strID);

    if(obj.style.display=='none')
    {
        obj.style.display='';
    
    }
    else 
    {
        obj.style.display='none';        
    }
}

function OpenWindow(strURL, strName, strWidth, strHeight){
    										
    var objPopup = window.open(strURL, strName, 'width=' + strWidth + ', height=' + strHeight + ', menubar=no, status=no, scrollbars=no, toolbar=no, resizable=1;');
    objPopup.focus()
}

function resizePopupScreen() {

    if(document.all) {
        var intWidthReduction=40;
    }
    else {
        var intWidthReduction=70;
    }


    if ( parseInt( document.body.clientWidth, 10 ) - intWidthReduction < 0 ) {
		divResize.style.width = 0;
	}
	else {
		divResize.style.width = parseInt( document.body.clientWidth, 10 ) - intWidthReduction;
	}
	
	if ( parseInt( document.body.clientHeight, 10 ) - 190 < 0 ) {			
		divResize.style.height = 0;
	}
	else {
		divResize.style.height = parseInt( document.body.clientHeight, 10 ) - 190;
	}
	
	return false;
}	

function button_rollover(strID, blnOver) {

    var obj=document.getElementById("td"+strID);
    
    if(blnOver) {
        obj.style.color='gold';
    }
    else {
        obj.style.color='white';
    }
}

function picture_rollover(strID, blnOver) {

    var objImg=document.getElementById("img"+strID);
    var objFont=document.getElementById("fnt"+strID);
    
    if(blnOver) {
        objImg.style.borderColor='#000000';
        objFont.style.color='#000000';
    }
    else {
        objImg.style.borderColor='#959595';
        objFont.style.color='#666666';
    }
}