/* Function : Image Maps */

function fnBuildImageMaps(){
	var cTemp = "";
	cTemp = cTemp + "<map id='topIcons' name='topIcons'>";
	cTemp = cTemp + "<area shape='rect' coords='0,0,42,50' alt='Home' title='Home' href='index.html' />";
	cTemp = cTemp + "<area shape='rect' coords='43,0,86,50' alt='Enquiry' title='Enquiry' href='enquiry.html' />";
	cTemp = cTemp + "<area shape='rect' coords='88,0,129,50' alt='Contact' title='Contact' href='contact-us.html' />";
	cTemp = cTemp + "<area shape='rect' coords='131,0,175,50' alt='Site Map' title='Site Map' href='site-map.html' />";
	cTemp = cTemp + "<area shape='rect' coords='177,0,220,50' alt='KTP WebMail' title='KTP WebMail' href='http://www.ktp.in:2095/' target='_blank' />";
	cTemp = cTemp + "</map>";
	cTemp = cTemp + "<map id='logoMaps' name='logoMaps'>";
	cTemp = cTemp + "<area shape='rect' coords='0,0,325,27' alt='Home' title='Home' href='index.html' />";
	cTemp = cTemp + "<area shape='rect' coords='0,28,325,50' alt='Sudhama Home' title='Sudhama Home' href='http://www.sudhamahosieries.com/' target='_blank' />";
	cTemp = cTemp + "</map>";

	document.write(cTemp);
}

/* Function : Top Menu */

function fnBuildTopMenu(){
	var cTemp = "";

	cTemp = cTemp + "<table id='menuKTP' width='760' border='0' cellspacing='0' cellpadding='0'>";
	cTemp = cTemp + "<tr>";
	cTemp = cTemp + "<td class='menuCell'><a href='about-us.html'>About Us</a></td><td width='2'><img src='images/menu-sep.gif' width='2' height='31' alt='KTP' /></td>";
	cTemp = cTemp + "<td class='menuCell'><a href='our-values.html'>Our Values</a></td><td width='2'><img src='images/menu-sep.gif' width='2' height='31' alt='KTP' /></td>";
	cTemp = cTemp + "<td class='menuCell'><a href='ktp-tour.html'>KTP Tour</a></td><td width='2'><img src='images/menu-sep.gif' width='2' height='31' alt='KTP' /></td>";
	cTemp = cTemp + "<td class='menuCell'><a href='rtc-fabrics.html'>RTC Fabrics</a></td><td width='2'><img src='images/menu-sep.gif' width='2' height='31' alt='KTP' /></td>";
	cTemp = cTemp + "<td class='menuCell'><a href='ktp-infra.html'>Infrastructure</a></td>	<td width='2'><img src='images/menu-sep.gif' width='2' height='31' alt='KTP' /></td>";
	cTemp = cTemp + "<td class='menuCell'><a href='job-flow.html'>Job Flow</a></td><td width='2'><img src='images/menu-sep.gif' width='2' height='31' alt='KTP' /></td>";
	cTemp = cTemp + "<td class='menuCell'><a href='contact-us.html'>Contact Us</a></td>";
	cTemp = cTemp + "</tr>";
	cTemp = cTemp + "</table>";

	document.write(cTemp);
}

/* Function : Bottom Links */

function fnBuildBottomLinks(){
	var cTemp = "";

	cTemp = cTemp + "<a href='index.html'>Home</a>&nbsp;~&nbsp;";
	cTemp = cTemp + "<a href='about-us.html'>About Us</a>&nbsp;~&nbsp;";
	cTemp = cTemp + "<a href='our-values.html'>Our Values</a>&nbsp;~&nbsp;";
	cTemp = cTemp + "<a href='ktp-tour.html'>KTP Tour</a>&nbsp;~&nbsp;";
	cTemp = cTemp + "<a href='rtc-fabrics.html'>RTC Fabrics</a>&nbsp;~&nbsp;";
	cTemp = cTemp + "<a href='ktp-infra.html'>Infrastructure</a>&nbsp;~&nbsp;";
	cTemp = cTemp + "<a href='job-flow.html'>Job Flow</a>&nbsp;~&nbsp;";
	cTemp = cTemp + "<a href='contact-us.html'>Contact Us</a>&nbsp;~&nbsp;";
	cTemp = cTemp + "<a href='site-map.html'>Site Map</a>";

	document.write(cTemp);
}


/* Function : Copyright */

function fnBuildCopyRight(){
	var cTemp = "";

	cTemp = cTemp + "<table width='760' border='0' cellspacing='0' cellpadding='0'>";
	cTemp = cTemp + "<tr>";
	cTemp = cTemp + "<td class='copyRight' width='670'>&copy; Copyright 2009 ~ Krishna Textile Process. All Rights Reserved.</td>";
	cTemp = cTemp + "<td width='20'><img src='images/icon-chk.png' width='18' height='18' alt='Valid XHTML &amp; CSS' /></td>";
	cTemp = cTemp + "<td width='35' class='validXHTMLCSS'><a href='http://validator.w3.org/check?uri=referer' target='_blank'>xhtml</a></td>";
	cTemp = cTemp + "<td width='20'><img src='images/icon-chk.png' width='18' height='18' alt='Valid XHTML &amp; CSS' /></td>";
	cTemp = cTemp + "<td width='35' class='validXHTMLCSS'><a href='http://jigsaw.w3.org/css-validator/check/referer' target='_blank'>css</a></td>";
	cTemp = cTemp + "</tr>";
	cTemp = cTemp + "</table>";

	document.write(cTemp);
}

/* Submit Form */

function fnSubmitForm(){
	var errorFlag = false;
	var name = document.getElementById("userValue").value;
	var email = document.getElementById("emailValue").value;
	var comments = document.getElementById("commentsValue").value;

	if(name == ""){
		document.getElementById("userError").innerHTML = "Enter Name";
		document.getElementById("userValue").style.borderColor="#f00";
		document.getElementById("user").style.color="#f00";
	}
	else {
		document.getElementById("userError").innerHTML = "";
		document.getElementById("userValue").style.borderColor="#FFBB67";
		document.getElementById("user").style.color="#969696";
		errorFlag = false;
	}
	if(email == ""){
		document.getElementById("emailError").innerHTML = "Enter Email Address";
		document.getElementById("emailValue").style.borderColor="#f00";
		document.getElementById("emailaddress").style.color="#f00";
	}
	else {
		var at="@";
		var dot=".";
		var lat=email.indexOf(at);
		var lstr=email.length;
		var ldot=email.indexOf(dot);

		if (email.indexOf(at)==-1){
			document.getElementById("emailError").innerHTML = "Invalid Email ID";
		}

		else if (email.indexOf(at)==-1 || email.indexOf(at)==0 || email.indexOf(at)==lstr){
			document.getElementById("emailError").innerHTML = "Invalid Email ID";
		}

		else if (email.indexOf(dot)==-1 || email.indexOf(dot)==0 || email.indexOf(dot)==lstr){
			document.getElementById("emailError").innerHTML = "Invalid Email ID";
		}

		else if (email.indexOf(at,(lat+1))!=-1){
			document.getElementById("emailError").innerHTML = "Invalid Email ID";
		 }

		else if (email.substring(lat-1,lat)==dot || email.substring(lat+1,lat+2)==dot){
			document.getElementById("emailError").innerHTML = "Invalid Email ID";
		 }

		else if (email.indexOf(dot,(lat+2))==-1){
			document.getElementById("emailError").innerHTML = "Invalid Email ID";
		 }
		
		else if (email.indexOf(" ")!=-1){
			document.getElementById("emailError").innerHTML = "Invalid Email ID";
		 }
		 else { 
			document.getElementById("emailError").innerHTML = "";
			document.getElementById("emailValue").style.borderColor="#FFBB67";
			document.getElementById("emailaddress").style.color="#969696";
			errorFlag = false;	
		}
	}
	if(comments == ""){
		document.getElementById("commentsError").innerHTML = "Enter Comments";
		document.getElementById("commentsValue").style.borderColor="#f00";
		document.getElementById("comments").style.color="#f00";
	}
	else {
		document.getElementById("commentsError").innerHTML = "";
		document.getElementById("commentsValue").style.borderColor="#FFBB67";
		document.getElementById("comments").style.color="#969696";
		errorFlag = true;
	}

	if(errorFlag){
		document.myForm.method="post";
		document.myForm.action="enquirySent.php";
		document.myForm.submit();
	}
	else{
		return false;
	}
}

/* Reset Form */

function fnResetForm(){
	document.getElementById("userError").innerHTML = "";
	document.getElementById("userValue").style.borderColor="#FFBB67";
	document.getElementById("emailError").innerHTML = "";
	document.getElementById("emailValue").style.borderColor="#FFBB67";
	document.getElementById("commentsError").innerHTML = "";
	document.getElementById("commentsValue").style.borderColor="#FFBB67";
	document.myForm.reset();
}

/* Disable Right Click */

<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Function Disabled!";

/*
if(navigator.userAgent.match(/Opera/ig)) {
	location.replace("opera-not-supported.html");
}
*/

///////////////////////////////////
function clickIE4(){
if (event.button==2){
//alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
//alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

//document.oncontextmenu=new Function("alert(message);return false")
document.oncontextmenu=new Function("return false")

// -->
