//	Author:  Noor Allah Al-Hiraki © 2004


function fullWindow(url)
{
	var str = "left=0,screenX=0,top=0,screenY=0,resizable=no,scrollbars=no";
	if (window.screen)
	{
		var ah = screen.availHeight - 36;
		var aw = screen.availWidth - 10;
		str += ",height=" + ah;
		str += ",innerHeight=" + ah;
		str += ",width=" + aw;
		str += ",innerWidth=" + aw;
	}
	window.open(url, "main", str);
}




function OpenContactForm(url)
{
	var xcen = (screen.availWidth - 500) / 2;
	var ycen = (screen.availHeight - 500) / 2;
	window.open(url, "contact_form", "height=500, width=500, screenX=" + xcen + ", screenY=" + ycen + ", left=" + xcen + ", top="+ycen);
}



function OpenThumb(img,ix,iy,ititle)
{
	var scrl = "yes";
	if (ix > screen.availWidth)
	{
		ratio = (screen.availWidth-100) / ix;
		ix = screen.availWidth-100;
		scrl = "yes";
	}
	var xcen = (screen.availWidth-ix)/2;
	var ycen = (screen.availHeight-iy)/2;
	win = window.open("","imageviewer","width="+ix+",height="+iy+",status=yes,menubar=no,toolbar=no,resizable=no,scrollable=yes,scrollbars="+scrl);
	win.focus();
	win.moveTo(xcen,ycen);
	win.resizeTo(ix+28,iy+72);
	win.document.open();
	win.document.write("<html><head><title>"+ititle+"</title>");
	win.document.write('</head><body>');
	win.document.write('<div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
	win.document.write("<img src="+img+"></div>");
	win.document.write("</body></html>");
	win.document.close();
	win.focus();
}




function color(elmnt)
{
	elmnt.style.filter=false
}




function gray(elmnt)
{
	elmnt.style.filter="gray()"
}



var formerrormsg="You\'ve attempted to submit the form multiple times.\n Please reload page if you need to resubmit form."


function checksubmit(submitbtn)
{
	submitbtn.form.submit();
	checksubmit=blocksubmit;
	return (false);
}

function blocksubmit()
{
	if (typeof formerrormsg!="undefined")
	alert(formerrormsg)
	return (false);
}
