
var imenu1 = new Image();
var imenu3 = new Image();
var imenu5 = new Image();
var imenu6 = new Image();
var imenu1a = new Image();
var imenu3a = new Image();
var imenu5a = new Image();
var imenu6a = new Image();
imenu1.src = "http://www.project-solutions.net/images/menu1.gif";
imenu3.src = "http://www.project-solutions.net/images/menu3.gif";
imenu5.src = "http://www.project-solutions.net/images/menu5.gif";
imenu6.src = "http://www.project-solutions.net/images/menu6.gif";
imenu1a.src = "http://www.project-solutions.net/images/menu1_a.gif";
imenu3a.src = "http://www.project-solutions.net/images/menu3_a.gif";
imenu5a.src = "http://www.project-solutions.net/images/menu5_a.gif";
imenu6a.src = "http://www.project-solutions.net/images/menu6_a.gif";

function showLayer(layerName) {
	eval("document.all['"+ layerName + "']"+ ".style.visibility='visible'" );
}

function hideLayer(layerName) {
	eval("document.all['"+ layerName + "']"+ ".style.visibility='hidden'" );
}

function menuActive(itm){
	itm.className="SubItemMenuActive";
}

function menuInActive(itm){
	itm.className="SubItemMenu";
}

function mainMenuActive(objName){
	eval("document.all['"+(objName)+"']").src = eval("i"+objName+"a").src;
}

function mainMenuInactive(objName){
	eval("document.all['"+(objName)+"']").src = eval("i"+objName+"").src;
}

function goNewPage(url){
	var wn = window.open(url, "", "");
}

function MM_openBrWindow(theURL,winName, wwidth, wheight, features) { //v2.0
//window.open(theURL,winName,features);
var heightspeed = 2; // vertical scrolling speed (higher = slower)
var widthspeed = 7;  // horizontal scrolling speed (higher = slower)
var leftdist = 0;    // distance to left edge of window
var topdist = 0;     // distance to top edge of window
	if (document.all) {
	var winwidth = wwidth; //window.screen.availWidth - leftdist;
	var winheight = wheight; //window.screen.availHeight - topdist;
	var sizer = window.open(theURL,"","left=" + leftdist + ",top=" + topdist + ",width=1,height=1,resizable=yes,scrollbars=yes");
		for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed) {
		sizer.resizeTo("1", sizeheight);
		}
		for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed) {
		sizer.resizeTo(sizewidth, sizeheight);
		}
		//sizer.location = theURL;
	}else
	//window.location = website;
	window.open(theURL,'win_htl',features);
}

function validPhoneNumber(name, txt){
	if (txt.length < 6){alert(name+" should has more than 6 characters");return false;}
	var template = "1234567890;-* ext:";
	for (var i =0; i < txt.length ;i++){
		if (template.indexOf(txt.charAt(i)) < 0){
			alert("Invalid "+name+" \n"+"Should input characters from template["+template+"]");
			return false;
		}
	}
	return true;
}

function validEmail(txt){
	if (txt.indexOf(" ") > -1){alert('Can not have space in Email Address');return false;}
	var adpos = txt.indexOf("@");
	var tmp = txt.substring(adpos+1, txt.length);
	var dotpos = tmp.indexOf(".");
	if ((dotpos == -1)||(dotpos+1 == tmp.length)){ return false; }else{ return true;}
}