//for window

function mywin(folder,folder1,page){
		outline = window.open(folder+'/'+folder1+'/'+page+'.htm','outline','fullScreen=no,menubar=no,location=no,resizable=no,scrollbars=no,status=no,toolbar=no,hotkeys=no,channelmode=no');
}

//for window

function myWin1(folder,page){
		outline = window.open(folder+'/'+page+'.htm','outline','fullScreen=no,menubar=no,location=no,resizable=no,scrollbars=auto,status=no,toolbar=no,hotkeys=no,channelmode=no');
}

function showHide1(e)
{
	if(e=="yes")
	{
		document.all.first.style.display='inline';
	}
	else
	{
		document.all.first.style.display='none';
	}
}



function MM_openBrWindow(theURL,winName,features)
{ 
  window.open(theURL,winName,features);
}

function openWin()
{
	var x,y;
	x=window.screen.availWidth;
	y=window.screen.availHeight;
	var w=window.open('disclaimer.htm','','width=450,height=135');
	var xx=x/2-275;
	var yy=y/2-75;
	w.moveTo(xx,yy);
}


//for guest form 

function guestCheck(guestForm)
{

	if (guestForm.name.value == "")
  	{
    	alert("Please enter your name");
    	guestForm.name.focus();
    	return (false);
  	}

	if (guestForm.gpost.value == "")
  	{
    	alert("Please enter your position");
    	guestForm.gpost.focus();
    	return (false);
  	}

	if (guestForm.gname.value == "")
  	{
    	alert("Please enter your company name");
    	guestForm.gname.focus();
    	return (false);
  	}
	
	if (guestForm.gphone.value == "")
  	{
    	alert("Please enter your phone number");
    	guestForm.gphone.focus();
    	return (false);
  	}

	if (guestForm.mymail.value == "")
  	{
    	alert("Please enter your email address");
    	guestForm.mymail.focus();
    	return (false);
  	}

	if (guestForm.vali.value == "")
  	{
    	alert("Please enter validation code");
    	guestForm.vali.focus();
    	return (false);
  	}

	if (guestForm.gcomments.value == "")
  	{
    	alert("Please enter your comments");
    	guestForm.gcomments.focus();
    	return (false);
  	}
	return (true);
}

//for guest email check....

function guestmyCheck()
{
	if(document.guestBook.mymail.value !='')
	{
		Str = new String((document.guestBook.mymail.value))
		Str1 = Str.indexOf('@')
		Str2 = Str.indexOf('.')
		Str41 = Str.indexOf('!')
		Str51 = Str.indexOf('#')
		Str61 = Str.indexOf('$')
		Str71 = Str.indexOf('%')
		Str81 = Str.indexOf('^')
		Str91 = Str.indexOf('&')
		Str101 = Str.indexOf('(')
		Str111 = Str.indexOf(')')
		Str131 = Str.indexOf('+')
		Str141 = Str.indexOf('=')
		Str151 = Str.indexOf('`')
		Str161 = Str.indexOf('~')
		Str171 = Str.indexOf('<')
		Str181 = Str.indexOf('>')
		Str191 = Str.indexOf('{')
		Str201 = Str.indexOf('}')
		Str211 = Str.indexOf('[')
		Str221 = Str.indexOf(']')
		Str241 = Str.indexOf('|')
		Str251 = Str.indexOf('/')
		Str261 = Str.indexOf('?')
		Str271 = Str.indexOf(',')
		Str281 = Str.indexOf('\'')
		if ((Str41>=0)||(Str51>=0) ||(Str61 >=0) ||(Str71>=0) || (Str81>=0)||(Str91>=0) ||(Str101>= 0)|| (Str111>=0) || (Str131>=0) ||(Str141>=0) ||(Str151>=0) ||(Str161>=0) || (Str171>=0) ||(Str181>=0) || (Str191>=0) || (Str201>=0) || (Str211>=0) || (Str221>=0) || (Str241>=0) || (Str251>=0) || (Str261>=0) || (Str271>=0) || (Str281>=0) )
		{
			alert ('Please do not enter any special characters in the email')
			document.guestBook.mymail.focus()
			return false;
		}
	}
	var eml1 = Str.indexOf('@')
	eml2=eml1+1;
	eml3=eml1-1;
	if (Str.charAt(eml2)=="." || Str.charAt(eml3)==".")
	{
		alert ('Please enter a valid email address')
		document.guestBook.mymail.focus()
		return false;
	}

	if (Str.length!=Str2+1)
	{
	
	}
	else
	{
		alert ('Please enter a valid email address')
		document.guestBook.mymail.focus()
		return false;
	}
	Str3 = Str.indexOf('@',(Str1+1))
	if (Str3<0)
	{
	}
	else
	{
		alert ('Your email address cannot have more than one @')
		document.guestBook.mymail.focus()
		return false;
	}
	if ((Str1>0) && (Str2>0))
	{
	}
	else
	{
		alert ('Please enter a valid email address')
		document.guestBook.mymail.focus()
		return false
	}
	Str = new String((document.guestBook.mymail.value))
	Str1 = Str.indexOf(' ')
	if (Str1==0)
	{
		alert ('Please do not leave a space before your Mail ID ')
		document.guestBook.mymail.focus()
		return false;
	}
	if (Str1 > 0)
	{
		alert ('Please do not leave a space in Mail ID ')
		document.guestBook.mymail.focus()
		return false;
	}
	Str99 = Str.indexOf(' ')
	if (Str99==0)
	{
		alert ('Please do not leave space in Mail ID ')
		document.guestBook.mymail.focus()
		return false;
	}
	else if ((Str99>0) && (Str99 < (Str.length)))
	{
		alert ('Please do not use spaces in Mail ID')
		document.guestBook.mymail.focus()
		return false;
	}

}

//Code for guestbook

function textCounter(field, countfield, maxlimit)
{
	if (field.value.length > maxlimit)
		
		field.value = field.value.substring(0, maxlimit);
	
	else

		countfield.value = maxlimit - field.value.length;
}


//for validation

function myValida()
{
	if ((document.guestBook.vali.value=='HnnG')||(document.guestBook.vali.value=='ryF8zn')||(document.guestBook.vali.value=='A34T')||(document.guestBook.vali.value=='pXT4F')||(document.guestBook.vali.value=='enesF'))
	{
		return true;
	}
	else
	{
		alert ('Please enter correct code\nCode is case sensitive');
		document.guestBook.vali.focus();
		return false;
	}
}

