function openWin( windowURL, windowName, windowFeatures ) { 
		return window.open( windowURL, windowName, windowFeatures ) ; 
	} 
function autofitIframe(id){
//if (!window.opera && !document.mimeType && document.all && document.getElementById){	
if (!window.opera && document.all && document.getElementById){
parent.document.getElementById(id).style.height=this.document.body.offsetHeight+"px";
}
else if(document.getElementById) {
parent.document.getElementById(id).style.height=this.document.body.scrollHeight+"px"
}
}

function autofitWindow(){
//if (!window.opera && !document.mimeType && document.all && document.getElementById){	
if (!window.opera && document.all && document.getElementById){
window.resizeTo(this.document.body.offsetWidth+10,this.document.body.offsetHeight+40);
}
else if(document.getElementById) {
	window.resizeTo(this.document.body.offsetWidth+6,this.document.body.scrollHeight+60);
}
}

// TABS CLASS AND FUNCTIONS
	var tabs = function (tObj,dObj)
		{
		this.ActiveClass = '';
		this.inActiveCalss = '';
		this.mouseOverClass = '';
		
		//this.name = 'ameen';
		this.Current = 0;					// CURRENT ACTIVE TAB
		this.tabObj = tObj;				// AN ARRAY OF TABS
		this.dataObj = dObj;			// AN ARRAY OF TABSDATA
		this.tmpHold = null;				// N/A
		
		this.init = function()
			{
			for(var u = 0; u<this.tabObj.length;u++)
				{
				document.getElementById(this.tabObj[u]).className=(u==this.Current)?this.inActiveCalss:this.ActiveClass;
				document.getElementById(this.dataObj[u]).style.display=(u==this.Current)?'block':'none';
				}
			};
		
		this.tglTab = function(newTab)
			{
			document.getElementById(this.tabObj[this.Current]).className=this.ActiveClass;	// hide current one
			document.getElementById(this.dataObj[this.Current]).style.display='none';
			document.getElementById(this.tabObj[newTab]).className=this.inActiveCalss;	// display new one
			document.getElementById(this.dataObj[newTab]).style.display='block';
			this.Current=newTab;
			}
		
		this.tabOver = function(newTab)
			{
			this.tmpHold = document.getElementById(this.tabObj[newTab]).className;	// hold old class
			document.getElementById(this.tabObj[newTab]).className=this.mouseOverClass;	// set the class of mouseover
			}
		
		this.tabOut = function(newTab)
			{
			document.getElementById(this.tabObj[newTab]).className=this.tmpHold;	// return holded class
			this.tmpHold = null;	// empty holded class
			}
		}
	// End TABS

	var isEmail = function(s) {
		var required = (arguments.length==2)?arguments[1]:false;
		var regexpEmail = /\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/;
		if(s.length){return regexpEmail.test(s);}
		else{return !required;}	// if empty: if required return false, if not req ret true
	};


/*  Tab Everywhere Script: plz kep it, most contents depends on it  */
	var lastTab = 1;	/* by default content first tab is the opened one */
	var tew_showIt = function (tid)
		{
		if(tid == lastTab) return;
		if(lastTab != 0)
			{
			// hide the last div
			window.document.getElementById("ted_"+lastTab).style.display="none";
			// remove the class of last tab
			window.document.getElementById("tet_"+lastTab).className="";
			}
		// make lastTab = tid
		lastTab = tid;
		// show the the current div
		window.document.getElementById("ted_"+lastTab).style.display="block";
		// set the class of current tab = active
		window.document.getElementById("tet_"+lastTab).className="active";
		}
