// JavaScript Document
startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}


function setSelectDefault(formName,selectName,preSelectedValue){
	//alert(1);
  var frm = document.forms[formName];
  var indexOfSelectedValue=-1;
    
  //alert("Setting value for " + selectName + " on form " + formName + "\nPre-selected value: " + preSelectedValue);
   
    	for (var i=0;i<frm.elements[selectName].options.length;i++){
                if (frm.elements[selectName].options[i].value == preSelectedValue){
                	indexOfSelectedValue = i;
                	break;		
                }
        }
        
       	if (indexOfSelectedValue >= 0){
       			frm.elements[selectName].selectedIndex = indexOfSelectedValue;
       	}
}


function confirmLogout(){
        
        
    if (confirm("Are you sure you want to logout?")){
        window.location.href="logout.php";
    }

}


function enlargeImage(imgSource,variableTitleTxt){
    
        var img = new Image();
        img.src = imgSource;
        
     		

        var imgWidth = img.width;
        var imgHeight = img.height;

				var variableTitle = variableTitleTxt;

        var urlToOpen = "picPopup.php?imgsource=" + escape(imgSource) + "&width=" + imgWidth + "&height=" + imgHeight+ "&variableTitle=" + variableTitle;

        
        var adjWinWidth = imgWidth+40;
        var adjWinHght = imgHeight+100;
        
     
        largePICWindow = window.open(urlToOpen,"PhiolmediaBackOfficePic","width=" + adjWinWidth+" ,height="+ adjWinHght +",menubar=no,status=no,scrollbars=no,resizable=yes,dependent,titlebar=no");
				
        largePICWindow.resizeTo(adjWinWidth,adjWinHght);
        	
        largePICWindow.focus();
        //largePICWindow.resizeTo(adjWinWidth,adjWinHght);
    }
	


function getSign(SignID){
        var urlToOpen = "?show=SignPopup&SignID=" + SignID;

        var adjWinWidth = 580;
        var adjWinHght =  350;
        
     
        SignWindow = window.open(urlToOpen,"PhiolmediaSign","width=" + adjWinWidth+" ,height="+ adjWinHght +",menubar=no,status=no,scrollbars=no,resizable=yes,dependent,titlebar=no");
				
        SignWindow.resizeTo(adjWinWidth,adjWinHght);
        	
        SignWindow.focus();
    }

