function PopoffWindow(DaURL, typeWindow) {

	switch (typeWindow){
		case "QuickHelp":
			ItsTheWindow = window.open(DaURL,"QuickHelp","top,status,height=450,width=350,resizable=no,scrollbars=1,toolbar=0");
			break;
		case "AddressBook":
			ItsTheWindow = window.open(DaURL,"QuickHelp","top,status,height=300,width=400,resizable=no,scrollbars=1,toolbar=0");
			break;
		case "PhGallery1":
			ItsTheWindow = window.open(DaURL,"PhGallery1","top,status,height=480,width=550,resizable=no,scrollbars=1,toolbar=0");
			break;
		case "PhGallery2":
			ItsTheWindow = window.open(DaURL,"PhGallery1","top,status,height=430,width=550,resizable=no,scrollbars=1,toolbar=0");
			break;			
		default:
			ItsTheWindow = window.open(DaURL,"800x600","status,height=600,width=800,resizable=no,toolbar=0");
						
			}
}

function validateSearch(thisForm) {

  if (thisForm._qsearch.value.length < 3)
        { alert('The search querry is incorrect!'); thisForm._qsearch.focus(); return (false);}
}


function validateMe(field) {
  var validNum = "0123456789 ,-+";
 
  for (var i=0; i<field.value.length; i++) 
   	 {temp = "" + field.value.substring(i, i+1);
   	 if (validNum.indexOf(temp) == "-1") 
   		{  alert("Only numbers are accepted for this field!");field.focus(); return false;}
  }
}

function setBorder(id,bOn,bcol1,bcol2)
{
	var oBgColour = document.all.item(id);
	
	if (bOn)
	{
		oBgColour.bgColor = bcol1;
	}
	else
	{
		oBgColour.bgColor = bcol2;
	}
}

function validateMe_EmailAddress(thisForm) {

  if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(thisForm._email.value))) {  alert('Sorry, but the email you entered it is not a valid one!'); thisForm._email.focus(); return (false);}
  
  }

function displayStatusBar(str){ window.status = str; return true }
function statusBarOff(){ return displayStatusBar(""); }


var frmTabs = false;
var tabCnt = 0;

function openTab(tab)
{
	if(frmTabs)
	{
		frmTabs.oTab.value = tab;
		for(ii=0;ii<tabCnt;ii++){
			if(document.getElementById('tab'+ii)){
				if (ii == tab){
					document.getElementById('tabMain'+ii).style.backgroundColor = "#ffffff";
					document.getElementById('tabMain'+ii).style.height = "20px";
					document.getElementById('tabMain'+ii).style.borderBottom = "";
					document.getElementById('tab'+ii).style.display = "";}
				else{
					document.getElementById('tabMain'+ii).style.backgroundColor = "#e1e7ee";
					document.getElementById('tabMain'+ii).style.borderBottom = "1px solid #6699cc";
					document.getElementById('tab'+ii).style.display = "none";}
			}
		}
	}
} 