
function element(id) {

    return document.getElementById(id); }
    
function invert(id) {
    div = element(id);
    if (div.style.display == 'block') {
        div.style.display = 'none'; }
    else {
        div.style.display = 'block'; } 
}

function popUpPicture(masterTypeID, pictureID, pictureRan, intHeight, intWidth){	
	myTop =  (screen.height - intHeight) / 2;
	myLeft = (screen.width  - intWidth) / 2;
	myWin = window.open("php/zoom.php?pictureID=" + pictureID + "&masterTypeID=" + masterTypeID + "&pictureRan=" + pictureRan + "&height=" + intHeight + "&width=" + intWidth, "picture" + pictureID,"Status=yes,toolbar=yes,location=no,top=" + myTop + ",left=" + myLeft + ",menu=no,width=" + (intWidth + 30) + ",height="  + (intHeight + 30) + ",scroll=yes,scrollbars=auto,resizable=yes");	
	myWin.focus();
}

NS4 = (document.layers)?1:0;
NS5 = (document.getElementById)?1:0;
NS6 = (document.getElementById)?1:0;
NS7 = (document.getElementById)?1:0;
IE4 = (document.all)?1:0;

if( IE4 == 1) NS5 = 0;
var strBrowserName = navigator.appName;
var fBrowserVersion = parseFloat(navigator.appVersion);
function getDiv(strDiv){
	 if (NS5) {
	    myDiv="document.getElementById('"+strDiv+"')";
	 }
	 if(NS4) {
	    myDiv="document.getElementById('"+strDiv+"')";
	 }
	 if(NS6) {
	    myDiv="document.getElementById('"+strDiv+"')";
	 }
	 if(NS7) {
	    myDiv="document.getElementById('"+strDiv+"')";
	 }
	 if(NS4) myDiv=strDiv;
	 
	 window.alert(myDiv.name);
	 return myDiv;
}

function setCss(projectID){
	var rows = document.getElementsByTagName("a");	
	for(var i=0; i<rows.length; i++) {
		strSplit = (rows[i].name).split("-");
		if (strSplit[0] == "pictureLink" + projectID)	rows[i].className="picture";
	}
}

function showProjectLong(strDiv){
	myDiv = getDiv(strDiv);
	if (myDiv.style.display=="none") myDiv.style.display="block";
	else myDiv.style.display="none";
}

function popUpPicture1(strFile, strTitle, intHeight, intWidth, scroll){
	myTop =  (screen.height - intHeight) / 2;
	myLeft = (screen.width  - intWidth) / 2;
	myWin = window.open("php/zoom.php?" + strFile, "picture","Status=no,toolbar=no,location=no,top=" + myTop + ",left=" + myLeft + ",menu=no,width=" + intWidth + ",height="  + intHeight + ",scroll=no,scrollbars=no");	
	myWin.focus();
}
function posPic(myHeight, myWidth){
	myTop =  (screen.height - myHeight) / 2;
	myLeft = (screen.width  - myWidth) / 2;
	window.moveTo(myLeft, myTop);	
	window.resizeTo(myWidth, myHeight);
	window.focus();
}
function checkPayment(max, myDonateFix, myDonateFree, msg){
		bolReturn = true;
		window.alert (myDonateFix);
		if (myDonateFix == (undefined)) {
		 if (myDonateFree < 10 ) bolReturn = false;
		 if (myDonateFree > max) bolReturn = false;	 
		}
		if (bolReturn == false) window.alert(msg);
		return bolReturn;
}
