navHover = function() {
	var lis = document.getElementById("navmenu").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
//if (window.attachEvent) window.attachEvent("onload", navHover);
function roll_over(img_name, img_src)
   {
   document[img_name].src = img_src;
   }

var activeImage = false;
function showImage()
	{
		if(activeImage){
			activeImage.style.filter = 'alpha(opacity=50)';	
			activeImage.style.opacity = 0.5;
			this.style.borderColor='#CCCCCC';
		}	
		this.style.filter = 'alpha(opacity=100)';
		this.style.opacity = 1;	
		activeImage = this;	
	}
	
function MM_findObj(n, d) { //v4.0

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var imageGalleryObj = document.getElementById('theImages');
var slideshowImages = imageGalleryObj.getElementsByTagName('IMG');
		for(var no=0;no<slideshowImages.length;no++){
			slideshowImages[no].onmouseover = showImage;
		}
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function searchvalid()
{
	if((document.frmsearch.txtsearch.value=="")||(document.frmsearch.txtsearch.value=="Search here..."))
	{
		alert("Please enter the search keyword");
		document.frmsearch.txtsearch.focus();
		return false;
	}
}
function validClient()
{
	if(document.login.txtUserName.value=="")
	{
		alert("Please enter the Username");
		document.login.txtUserName.focus();
		return false;
	}
	if(document.login.txtpassword.value=="")
	{
		alert("Please enter the password");
		document.login.txtpassword.focus();
		return false;
	}
}
function submitpub()
{
	document.pub.pubId.value='1';
}
var popupwin;
function popUp(url)
{
	if(popupwin)
	{
		if(!popupwin.closed) popupwin.close();
	}
	popupwin=open(url,'popupwin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,width=500,height=500,left=200,top=250');
}
function validnewsletter(strurl)
{
	//alert("test");
	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = newsletter.email.value.match(emailPat);
	if(document.newsletter.email.value=="")
	{
		alert("Please enter the email address");
		return false;
	}
	else
	{
		if (matchArray == null)
		{
			alert ("Please enter your valid email address.");
			document.newsletter.email.focus();
			return false;
		}
		else
		{
			popUp(strurl+'newsletter.php?email='+document.newsletter.email.value);
		}
	}
	document.newsletter.email.value='';
	return false;
}
function checkbooking()
{
    var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = bookmeet.email.value.match(emailPat);
	//var matchArray1 = newuser2.alt_email.value.match(emailPat);
	if(document.bookmeet.email.value=="")
		{
			alert("Please enter the email address");
			document.bookmeet.email.focus();
			return false;
		}
	else
	{
		if (matchArray == null)
		{
			alert ("Please enter your valid email address.");
			document.bookmeet.email.focus();
			return false;
		}
	}
}
function clearTip(field)
{
	if(field.defaultValue == field.value)
	field.value = "";
}

function writeTip(field)
{
	if(field.value == "")
		field.value = field.defaultValue;
}
function chkcontact()
{
	if(document.contactus.fName==undefined)
	{
	}
	else
	{
		if((document.contactus.fName.value=="")&&(document.contactus.fName.className=="required"))
		{
				alert (document.contactus.fName_msg.value);
				document.contactus.fName.focus();
				return false;
		}
	}
	if(document.contactus.lName==undefined)
	{
	}
	else
	{
		if((document.contactus.lName.value=="")&&(document.contactus.lName.className=="required"))
		{
				alert (document.contactus.lName_msg.value);
				document.contactus.lName.focus();
				return false;
		}
	}
	
	
	if(document.contactus.email==undefined)
	{
	}
	else
	{
		var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
		var matchArray = contactus.email.value.match(emailPat);
		if((document.contactus.email.value=="")&&(document.contactus.email.className=="required"))
			{
				alert (document.contactus.email_msg.value);
				document.contactus.email.focus();
				return false;
			}
		else
		{
			if ((matchArray == null)&&(document.contactus.email.className=="required"))
			{
				alert (document.contactus.email_msg.value);
				document.contactus.email.focus();
				return false;
			}
		}
	}
	if(document.contactus.company==undefined)
	{
	}
	else
	{
		if((document.contactus.company.value=="")&&(document.contactus.company.className=="required"))
		{
				alert (document.contactus.company_msg.value);
				document.contactus.company.focus();
				return false;
		}
	}
	if(document.contactus.telephone==undefined)
	{
	}
	else
	{
		if((document.contactus.telephone.value=="")&&(document.contactus.telephone.className=="required"))
		{
				alert (document.contactus.telephone_msg.value);
				document.contactus.telephone.focus();
				return false;
		}
	}
	if(document.contactus.fax==undefined)
	{
	}
	else
	{
		if((document.contactus.fax.value=="")&&(document.contactus.fax.className=="required"))
		{
				alert (document.contactus.fax_msg.value);
				document.contactus.fax.focus();
				return false;
		}
	}
	if(document.contactus.add==undefined)
	{
	}
	else
	{
		if((document.contactus.add.value=="")&&(document.contactus.add.className=="required"))
		{
				alert (document.contactus.add_msg.value);
				document.contactus.add.focus();
				return false;
		}
	}
	if(document.contactus.zip==undefined)
	{
	}
	else
	{
		if((document.contactus.zip.value=="")&&(document.contactus.zip.className=="required"))
		{
				alert (document.contactus.zip_msg.value);
				document.contactus.zip.focus();
				return false;
		}
	}
	if(document.contactus.city==undefined)
	{
	}
	else
	{
		if((document.contactus.city.value=="")&&(document.contactus.city.className=="required"))
		{
				alert (document.contactus.city_msg.value);
				document.contactus.city.focus();
				return false;
		}
	}
	if(document.contactus.state==undefined)
	{
	}
	else
	{
		if((document.contactus.state.value=="")&&(document.contactus.state.className=="required"))
		{
				alert (document.contactus.state_msg.value);
				document.contactus.state.focus();
				return false;
		}
	}
	if(document.contactus.country==undefined)
	{
	}
	else
	{
		if((document.contactus.country.value=="")&&(document.contactus.country.className=="required"))
		{
				alert (document.contactus.country_msg.value);
				document.contactus.country.focus();
				return false;
		}
	}
	if(document.contactus.comment==undefined)
	{
	}
	else
	{
		if((document.contactus.comment.value=="")&&(document.contactus.comment.className=="required"))
		{
				alert (document.contactus.comment_msg.value);
				document.contactus.comment.focus();
				return false;
		}
	}
	
}
function chkuser2()
{
	if(document.newuser2.namex.value=="")
	{
		alert("Please Enter Your First Name.");
		document.newuser2.namex.focus();
		return false;
	}
	if(document.newuser2.company.value=="")
	{
		alert("Please Enter Your Company Name.");
		document.newuser2.company.focus();
		return false;
	}
	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = newuser2.email.value.match(emailPat);
	//var matchArray1 = newuser2.alt_email.value.match(emailPat);
	if(document.newuser2.email.value=="")
		{
			alert("Please enter the email address");
			document.newuser2.email.focus();
			return false;
		}
	else
	{
		if (matchArray == null)
		{
			alert ("Please enter your valid email address.");
			document.newuser2.email.focus();
			return false;
		}
	}
	/*if(document.newuser.alt_email.value!="")
	{
	if (matchArray1 == null)
		{
			alert ("Please enter your valid email address.");
			document.newuser.alt_email.focus();
			return false;
		}
	}
	if(document.newuser.userName.value=="")
	{
		    alert ("Please Enter Your UserName For Login.");
		    document.newuser.userName.focus();
			return false;
	}
	if(document.newuser.password.value=="")
	{
		    alert ("Please Enter Your Password.");
		    document.newuser.password.focus();
			return false;
	}
	
	if(document.newuser.question.value=="")
	{
		    alert ("Please Select Your Question.");
		    document.newuser.question.focus();
			return false;
	}
	if(document.newuser.answer.value=="")
	{
		    alert ("Please Select Your Answer.");
		    document.newuser.answer.focus();
			return false;
	}*/
	if(document.newuser2.country.value=="")
	{
		    alert ("Please Select Your Country.");
		    document.newuser2.country.focus();
			return false;
	}
}
function sextractPageName(xhrefString)
{
	var arrx = xhrefString.split('.');
	arrx = arrx[arrx.length-2].split('/');
	return arrx[arrx.length-1].toLowerCase();		
}
function ssetActiveMenu(arrx, xcrtPage)
{
	for(var i=0; i < arrx.length; i++)
		if(sextractPageName(arrx[i].href) == xcrtPage)
		{
			arrx[i].className = "current";
			arrx[i].parentNode.className = "current";
		}
}

function ssetPage()
{
	
	if(document.location.href) 
		xhrefString = document.location.href;
	else
		xhrefString = document.location;

	if (document.getElementById("navmenu")!=null) 
		ssetActiveMenu(document.getElementById("navmenu").getElementsByTagName("a"), sextractPageName(xhrefString));

}

function langextractPageName( langhrefString)
{
	var arrlang =  langhrefString.split('.');
	arrlang = arrlang[arrlang.length-2].split('/');
	//alert(arrlang[arrlang.length-1].toLowerCase());
	return arrlang[arrlang.length-1].toLowerCase();		
}

function langsetActiveMenu(arrlang, langcrtPage)
{
	for(var i=0; i < arrlang.length; i++)
		if(langextractPageName(arrlang[i].href) == langcrtPage)
		{
			arrlang[i].className = "selected";
			arrlang[i].parentNode.className = "selected";
		}
}

function langsetPage()
{
	
	if(document.location.href) 
		langhrefString = document.location.href;
	else
		langhrefString = document.location;

	if (document.getElementById("lang")!=null) 
		langsetActiveMenu(document.getElementById("lang").getElementsByTagName("a"), langextractPageName(langhrefString));

}
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		empover = newImage("images/empover-over.jpg");
		candover = newImage("images/candoverover.jpg");
		preloadFlag = true;
	}
}preloadImages();
//********Scroll bar********//
var contentHeight = 0; 	// The total height of the content
	var visibleContentHeight = 0;	
	var scrollActive = false;
	
	var scrollHandleObj = false; // reference to the scroll handle
	var scrollHandleHeight = false;
	var scrollbarTop = false;
	var eventYPos = false;

	var scrollbuttonActive = false;
	var scrollbuttonDirection = false;
	var scrollbuttonSpeed = 2; // How fast the content scrolls when you click the scroll buttons(Up and down arrows)
	var scrollTimer = 10;	// Also how fast the content scrolls. By decreasing this value, the content will move faster	
	
	var scrollMoveToActive = false;
	var scrollMoveToYPosition = false;
	function scrollDiv_startScroll(e)
	{
		if(document.all)e = event;
		scrollbarTop = document.getElementById('scrolldiv_theScroll').offsetTop;
		eventYPos = e.clientY;
		scrollActive = true;
	}
	
	function scrollDiv_stopScroll()
	{
		scrollActive = false;
		scrollbuttonActive = false;
		scrollMoveToActive = false;
	}
	function scrollDiv_scroll(e)
	{
		if(!scrollActive)return;
		if(document.all)e = event;
		if(e.button!=1 && document.all)return;
		var topPos = scrollbarTop + e.clientY - eventYPos; 
		if(topPos<0)topPos=0;
		if(topPos/1>visibleContentHeight-(scrollHandleHeight+4)/1)topPos = visibleContentHeight-(scrollHandleHeight+4);
		document.getElementById('scrolldiv_theScroll').style.top = topPos + 'px';
		document.getElementById('scrolldiv_content').style.top = 0 - Math.floor((contentHeight) * ((topPos)/(visibleContentHeight-scrollHandleHeight)))+'px' 
	}
	
	/*
	Click on the slider
	Move the content to the this point
	*/
	function scrolldiv_scrollMoveToInit(e)
	{		
		if(document.all)e = event;
		scrollMoveToActive = true;
		scrollMoveToYPosition = e.clientY - document.getElementById('scrolldiv_scrollbar').offsetTop;
		if(document.getElementById('scrolldiv_theScroll').offsetTop/1 > scrollMoveToYPosition) scrollbuttonDirection = scrollbuttonSpeed*-2; else  scrollbuttonDirection = scrollbuttonSpeed*2;
		scrolldiv_scrollMoveTo();	
	}
	
	function scrolldiv_scrollMoveTo()
	{
		if(!scrollMoveToActive || scrollActive)return;
		var topPos = document.getElementById('scrolldiv_theScroll').style.top.replace('px','');
		topPos = topPos/1 + scrollbuttonDirection;
		if(topPos<0){
			topPos=0;
			scrollMoveToActive=false;
		}
		if(topPos/1>visibleContentHeight-(scrollHandleHeight+4)/1){
			topPos = visibleContentHeight-(scrollHandleHeight+4);	
			scrollMoveToActive=false;
		}
		if(scrollbuttonDirection<0 && topPos<scrollMoveToYPosition-scrollHandleHeight/2)return;	
		if(scrollbuttonDirection>0 && topPos>scrollMoveToYPosition-scrollHandleHeight/2)return;			
		document.getElementById('scrolldiv_theScroll').style.top = topPos + 'px';
		document.getElementById('scrolldiv_content').style.top = 0 - Math.floor((contentHeight) * ((topPos)/(visibleContentHeight-scrollHandleHeight)))+'px' 		
		setTimeout('scrolldiv_scrollMoveTo()',scrollTimer);		
	}
	
	function cancelEvent()
	{
		return false;			
	}

	function scrolldiv_scrollButton()
	{
		if(this.id=='scrolldiv_scrollDown')scrollbuttonDirection = scrollbuttonSpeed; else scrollbuttonDirection = scrollbuttonSpeed*-1;
		scrollbuttonActive=true;
		scrolldiv_scrollButtonScroll();
	}
	function scrolldiv_scrollButtonScroll()
	{
		if(!scrollbuttonActive)return;
		var topPos = document.getElementById('scrolldiv_theScroll').style.top.replace('px','');
		topPos = topPos/1 + scrollbuttonDirection;
		if(topPos<0){
			topPos=0;
			scrollbuttonActive=false;
		}
		if(topPos/1>visibleContentHeight-(scrollHandleHeight+4)/1){
			topPos = visibleContentHeight-(scrollHandleHeight+4);	
			scrollbuttonActive=false;
		}	
		document.getElementById('scrolldiv_theScroll').style.top = topPos + 'px';
		document.getElementById('scrolldiv_content').style.top = 0 - Math.floor((contentHeight) * ((topPos)/(visibleContentHeight-scrollHandleHeight)))+'px' 			
		setTimeout('scrolldiv_scrollButtonScroll()',scrollTimer);
	}
	function scrolldiv_scrollButtonStop()
	{
		scrollbuttonActive = false;
	}
	
	
	function scrolldiv_initScroll()
	{
		visibleContentHeight = document.getElementById('scrolldiv_scrollbar').offsetHeight ;
		contentHeight = document.getElementById('scrolldiv_content').offsetHeight - visibleContentHeight;		
		scrollHandleObj = document.getElementById('scrolldiv_theScroll');
		scrollHandleHeight = scrollHandleObj.offsetHeight;
		scrollbarTop = document.getElementById('scrolldiv_scrollbar').offsetTop;		
		document.getElementById('scrolldiv_theScroll').onmousedown = scrollDiv_startScroll;
		document.body.onmousemove = scrollDiv_scroll;
		document.getElementById('scrolldiv_scrollbar').onselectstart = cancelEvent;
		document.getElementById('scrolldiv_theScroll').onmouseup = scrollDiv_stopScroll;
		if(document.all)document.body.onmouseup = scrollDiv_stopScroll; else document.documentElement.onmouseup = scrollDiv_stopScroll;
		document.getElementById('scrolldiv_scrollDown').onmousedown = scrolldiv_scrollButton;
		document.getElementById('scrolldiv_scrollUp').onmousedown = scrolldiv_scrollButton;
		document.getElementById('scrolldiv_scrollDown').onmouseup = scrolldiv_scrollButtonStop;
		document.getElementById('scrolldiv_scrollUp').onmouseup = scrolldiv_scrollButtonStop;
		document.getElementById('scrolldiv_scrollUp').onselectstart = cancelEvent;
		document.getElementById('scrolldiv_scrollDown').onselectstart = cancelEvent;
		document.getElementById('scrolldiv_scrollbar').onmousedown = scrolldiv_scrollMoveToInit;
	}
	/*
	Change from the default color
	*/	
	function scrolldiv_setColor(rgbColor)
	{
		document.getElementById('scrolldiv_scrollbar').style.borderColor = rgbColor;
		document.getElementById('scrolldiv_theScroll').style.backgroundColor = rgbColor;
		document.getElementById('scrolldiv_scrollUp').style.borderColor = rgbColor;
		document.getElementById('scrolldiv_scrollDown').style.borderColor = rgbColor;
		document.getElementById('scrolldiv_scrollUp').style.color = rgbColor;
		document.getElementById('scrolldiv_scrollDown').style.color = rgbColor;
		document.getElementById('scrolldiv_parentContainer').style.borderColor = rgbColor;
	}
	/*
	Setting total width of scrolling div
	*/
	function scrolldiv_setWidth(newWidth)
	{
		document.getElementById('dhtmlgoodies_scrolldiv').style.width = newWidth + 'px';
		document.getElementById('scrolldiv_parentContainer').style.width = newWidth-30 + 'px';		
	}
	
	/*
	Setting total height of scrolling div
	*/
	function scrolldiv_setHeight(newHeight)
	{
		document.getElementById('dhtmlgoodies_scrolldiv').style.height = newHeight + 'px';
		document.getElementById('scrolldiv_parentContainer').style.height = newHeight + 'px';
		document.getElementById('scrolldiv_slider').style.height = newHeight + 'px';
		document.getElementById('scrolldiv_scrollbar').style.height = newHeight-40 + 'px';		
	}
	/*
	Setting new background color to the slider 
	*/
	function setSliderBgColor(rgbColor)
	{
		document.getElementById('scrolldiv_scrollbar').style.backgroundColor = rgbColor;
		document.getElementById('scrolldiv_scrollUp').style.backgroundColor = rgbColor;
		document.getElementById('scrolldiv_scrollDown').style.backgroundColor = rgbColor;
	}
	/*
	Setting new content background color
	*/
	function setContentBgColor(rgbColor)
	{
		document.getElementById('scrolldiv_parentContainer').style.backgroundColor = rgbColor;
	}
	
	/*
	Setting scroll button speed
	*/
	function setScrollButtonSpeed(newScrollButtonSpeed)
	{
		scrollbuttonSpeed = newScrollButtonSpeed;
	}
	/*
	Setting interval of the scroll
	*/
	function setScrollTimer(newInterval)
	{
		scrollTimer = newInterval;
	}