function header(){
document.write('<table border="0" cellpadding="0" cellspacing="0" width="980" align="center">');
document.write('<tr><td width="93" height="86"  rowspan="2" valign="top"><a href="http://www.kashmirtmart.com">');
document.write('<img src="http://desh/kashmir-mart-new/images/top_logo.jpg" alt="kashmirmart.com" border="0" width="93" height="86" ></a></td>');
document.write('<td width="887" height="46" valign="bottom" colspan="2"><div align="center"><center>');
document.write('<table border="0" cellpadding="0" cellspacing="0" width="887"><tr>');
document.write('<td width="443" height="47" valign="bottom"><font style="font-style:Arial;color:#97714D;font-size:27px;"><span style="letter-spacing: 1.5pt"><b> &nbsp;</b>KASHMIR');
document.write('MART</span></font></td>');
document.write('<td width="442" align="right" height="46" valign="bottom"><img border="0" src="http://desh/kashmir-mart-new/images/call_img_banner.jpg" alt="Call Us" width="312" height="28"></td>');
document.write('</tr></table></center></div></td></tr><tr><td width="874" style="background-image: url(\'http://desh/kashmir-mart-new/images/top_green_bg.jpg\'); background-repeat: repeat-x" height="39" align="right">');
document.write('<div align="right"><table border="0" cellpadding="0" cellspacing="0" width="60%" class="top-menu"><tr>');
document.write('<td align="center"><a href="http://desh/kashmir-mart-new/index.php" class="top-menu">Home</a></td>');
document.write('<td width="1" align="center">|</td>');
document.write('<td align="center"><a href="http://desh/kashmir-mart-new/login.php" class="top-menu">List your company</a></td>');
document.write('<td width="1" align="center">|</td>');
document.write('<td align="center"><a href="http://desh/kashmir-mart-new/suggest_cat.php" class="top-menu">Suggest Category</a></td>');
document.write('<td width="1" align="center">|</td>');
document.write('<td align="center"><a href="http://desh/kashmir-mart-new/feedback.php" class="top-menu">Feed Back</a></td>');
document.write('<td align="center" width="1">|</td>');
document.write('<td align="center"><a href="http://desh/kashmir-mart-new/contactus.php" class="top-menu">Contact US</a></td>');
document.write('<td width="1" align="center">|</td>');
document.write('<td align="center"><a href="http://desh/kashmir-mart-new/sitemap.php" class="top-menu">Site Map</a></td>');
document.write('</tr></table></div></td>');
document.write('<td width="13" style="background-image: url(\'http://desh/kashmir-mart-new/images/green_top_right.jpg\'); background-repeat: no-repeat" height="39">');
document.write('</td></tr></table>');
document.write('<table border="0" cellpadding="0" cellspacing="0" width="980" align="center" >');
document.write('<tr><td  width="16" height="46">&nbsp;</td><td width="974" height="50" valign="Middle">');
document.write('<!-- SiteSearch Google --><form method="get" action="http://www.google.co.in/custom" target="google_window">');
document.write('<br><table cellspacing="0" cellpadding="0" align="center"><tr><td valign="middle"><font style="font-style:Verdana;color:#97714D;font-size:16px;font-weight:bold;"><img border="0" src="http://desh/kashmir-mart-new/images/search_img.jpg" width="45" height="14"></font></td>');
document.write('<td>&nbsp;<input type="hidden" name="domains" value="KashmirMart.com"><input type="text" name="q" size="40" maxlength="255" value="Enter your keywords" id="sbi" style="color: #000000; ">');
document.write('&nbsp;&nbsp;</td><td><input type="image" src="http://desh/kashmir-mart-new/images/go_but.jpg" name="sa" value="Google Search" id="sbb" width="34" height="20"><td>');
document.write('<td>&nbsp;&nbsp;<input type="radio" name="sitesearch" value="" id="ss0"><label for="ss0" title="Search the Web"><font face="Century,Century Schoolbook,arial" size="-1" color="#C2724C">&nbsp;Web</font></label></td>');
document.write('<td>&nbsp;&nbsp;<input type="radio" name="sitesearch" value="KashmirMart.com" checked id="ss1"></input>');
document.write('<label for="ss1" title="Search KashmirMart.com"><font face="Century,Century Schoolbook,arial" size="-1" color="#C2724C">&nbsp;KashmirMart.com</font></label></td>');
document.write('</tr></table><input type="hidden" name="client" value="pub-2287988026259904"><input type="hidden" name="forid" value="1"><input type="hidden" name="channel" value="5512933434">');
document.write('<input type="hidden" name="ie" value="ISO-8859-1"><input type="hidden" name="oe" value="ISO-8859-1"><input type="hidden" name="cof" value="GALT:#0066CC;GL:1;DIV:#999999;VLC:336633;AH:center;BGC:FFFFFF;LBGC:F2984C;ALC:0066CC;LC:0066CC;T:000000;GFNT:666666;GIMP:666666;LH:50;LW:200;L:http://kashmirmart.com/images/logo.jpg;S:http://;FORID:1">');
document.write('<input type="hidden" name="hl" value="en"></form></td></tr></table>');
}


function rightpanel(){
document.write(' <div align="right"><table border="0" cellpadding="0" cellspacing="0" width="312"><tr><td style="background-image: url(\'../images/registration_bg.jpg\'); background-repeat: no-repeat" width="312"><table border="0" cellpadding="0" cellspacing="0" width="312" ><tr><td><table border="0" cellpadding="0" cellspacing="0" width="312" class="registerbanner"><tr><td width="1" height="35"></td><td width="181" height="35"></td></tr><tr><td width="10" height="47" rowspan="10"></td><td width="181"></td></tr><tr><td width="181"><img border="0" src="../images/blak_bullet.gif" width="5" height="5" alt="">&nbsp;Register Your Company.</td></tr><tr><td width="181"></td></tr><tr><td width="181"><img border="0" src="../images/blak_bullet.gif" width="5" height="5" alt="">&nbsp;Get business.</td></tr><tr><td width="181"></td></tr><tr><td width="181"><img border="0" src="../images/blak_bullet.gif" width="5" height="5" alt="">&nbsp;Promotion of your business.</td></tr><tr><td width="181"></td></tr><tr><td width="181"><img border="0" src="../images/blak_bullet.gif" width="5" height="5" alt="">&nbsp;Grow your business.</td></tr><tr><td width="181" height="5"></td></tr><tr><td width="181" >&nbsp;&nbsp; <a href="http://desh/kashmir-mart-new/login.php"><img border="0" src="../images/register_icon.gif" width="104" height="23" alt="Registration"></a></td></tr><tr><td width="1" height="10"></td><td width="181" height="10"><br><br></td></tr></table></td></tr></table></td></tr><tr><td height="10"></td></tr><tr><td><table border="0" cellpadding="0" cellspacing="0" width="312"><tr><td width="312"  height="165" style="background-image: url(\'../images/online_bg.jpg\'); background-repeat: no-repeat" valign="top"><div align="center"><form name="frm" method="post" action="http://www.kashmirhotels.net/search_hotel.php" target="_blank" onSubmit="return hotel();"><table border="0" cellpadding="0" cellspacing="0" width="312" class="formcaption"><tr><td width="250" height="40"></td><td width="70" height="40" align="right"></td><td width="200" height="40"></td></tr><tr><td width="250">&nbsp;</td><td width="70" align="right">Destination :</td><td width="200">&nbsp;<select id="s8" size="1" name="city" class="gradient"><option value="Srinagar" selected>Srinagar</option><option value="Pahalgam">Pahalgam</option><option value="Gulmarg">Gulmarg</option><option value="Jammu">Jammu</option><option value="Katra">Katra</option><option value="Ladakh">Ladakh</option><option value="Sonmarg">Sonmarg</option><option value="Patnitop">Patnitop</option><option value="Sanasar">Sanasar</option></select></td></tr><tr><td width="250" height="5"></td><td width="70" height="5" align="right"></td><td width="200" height="5"></td></tr><tr><td width="250">&nbsp;</td><td width="70" align="right">Check in :&nbsp;</td><td width="200">&nbsp;<input type="text" name="checkin_date" size="10" class="gradient" readonly>');
var basicCal3= new calendar("FIELD:document.frm.checkin_date;MOVEMODE:1;DIR:../primoris;YEAR:2;MONTH:2;FORMAT:2;DELIMITER:-;");
basicCal3.writeCalendar();
document.write('</td></tr><tr><td width="250" height="5"></td><td width="70" height="5" align="right"></td><td width="200" height="5"></td></tr><tr><td width="250">&nbsp;</td><td width="70" align="right">rooms :&nbsp;</td><td width="200">&nbsp;<select size="1" name="numberOfRooms" id="room" class="gradient"><option value="1" selected>1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option></select>&nbsp; nights : <select size="1" name="numberOfNights" class="gradient"><option value="1" selected>1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option></select></td></tr><tr><td width="250" height="5"></td><td width="70" align="right" height="5"></td><td width="200" align="center" height="5"></td></tr><tr><td width="250">&nbsp;</td><td width="70" align="right"></td><td width="200"><input type="image" src="../images/booknow_icon.gif" value="Submit" name="I1" width="77" height="23"></td></tr></table></form></div></td></tr><tr><td width="312"></td></tr><tr><td width="312" ><table border="0" cellpadding="0" cellspacing="0" width="312"><tr><td width="312"  height="132" style="background-image: url(\'../images/kashmirtour_bg.jpg\'); background-repeat: no-repeat" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="312" class="registerbanner"><tr><td width="1" height="35"></td><td width="181" height="35"></td></tr><tr><td width="12" height="47" rowspan="7"></td><td width="181" height="12"></td></tr><tr><td width="181"><a href="http://www.kashmirtourism.org/winter-sports-package.html" class="registerbanner" target="_blank">Winter Special Tour Packages</a></td></tr><tr><td width="181"></td></tr><tr><td width="181"><a href="http://www.kashmirtourism.org/adventure-tour-package.html" class="registerbanner" target="_blank">Adventure Tour Packages</a></td></tr><tr><td width="181"></td></tr><tr><td width="181"><a href="http://www.kashmirtourism.org/summer-tour-packages.html" class="registerbanner" target="_blank">Summer Special Tour Packages</a></td></tr><tr><td width="181"></td></tr><tr><td width="1" height="10"></td><td width="181"></td></tr></table></td></tr></table></td></tr><tr><td width="312" height="15" ></td></tr><tr><td width="312" ><div align="right"><table border="0" cellpadding="0" cellspacing="0" width="312"><tr><td width="312" style="background-image: url(\'../images/website_banner.jpg\'); background-repeat: no-repeat" height="86" valign="top"><div width="50px"  style="padding-top:10px;padding-left:100px" class="webpromotion">Get a Web Site now</div><table width="312" class="webpromotion1"><tr><td width="75"></td><td width="237"><UL><LI><a href="Get_a_Website.php" class="webpromotion1">Domain Booking and Hosting</a><LI><a href="Get_a_Website.php" class="webpromotion1">Web Desigining and Development</a><LI><a href="Get_a_Website.php" class="webpromotion1">Web Promotion</a></UL></td></tr></table></td></tr></table></div></td></tr></table></td></tr></table></div>');
}



function footer(){
document.write('<div align="center"><center><table border="0" cellpadding="0" cellspacing="0" width="900" class="footer"><tr><td align="center" height="80"></td></tr><tr><td align="center" height="1" bgcolor="#C8AC93"></td></tr><tr><td align="center" height="20"></td></tr></table><table border="0" cellpadding="0" cellspacing="0" width="800" class="footer"><tr>');
document.write('<td align="center"><a href="http://desh/kashmir-mart-new/index.php" class="footer">Home</a></td>');
document.write('<td align="center" >|</td>');
document.write('<td align="center" ><a href="http://desh/kashmir-mart-new/about_us.php" class="footer">About Us</a></td>');
document.write('<td align="center" >|</td>');
document.write('<td align="center" ><a href="http://desh/kashmir-mart-new/contactus.php" class="footer">Contact Us</a></td>');
document.write('<td align="center" >|</td>');
document.write('<td align="center" ><a href="http://desh/kashmir-mart-new/sitemap.html" class="footer">Sitemap</a></td>');
document.write('<td align="center" >|</td>');
document.write('<td align="center" ><a href="http://desh/kashmir-mart-new/feedback.php" class="footer">Feedback</a></td>');
document.write('<td align="center" >|</td>');
document.write('<td align="center"><a href="http://desh/kashmir-mart-new/disclaimer.php" class="footer">Disclaimer</a></td>');
document.write('<td align="center">|</td>');
document.write('<td align="center"><a href="http://desh/kashmir-mart-new/suggest_cat.php" class="footer">Suggest Category</a></td>');
/*document.write('<td align="center">|</td>');
document.write('<td align="center"><a href="http://desh/kashmir-mart-new/privacy_policy.php" class="footer">Privacy Policy</a></td>');
document.write('<td align="center">|</td>');
document.write('<td align="center"><a href="http://desh/kashmir-mart-new/terms_and_conditions.php" class="footer">Terms &amp; Condition</a></td>');*/
document.write('</tr></table></center></div><div align="center"><center><table border="0" cellpadding="0" cellspacing="0" width="900" class="footer"><tr><td align="right" height="5"></td><td align="right" width="20"></td></tr><tr><td align="center">© Copyright <a class="links" href="http://www.kashmirmart.com" target="_balnk">kashmirmart.com</a>&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;Website Powered by <a class="links" href="http://www.emavens.com" target="_blank">eMaven Solutions</a></td><td align="right" width="20"></td></tr></table></center></div>');
}


















////////THIS FUNCTION TRIMS THE TRAILING WHITE SPACES IN A GIVEN STRING.
function trim(str1){
// This function trims any given field value for blank spaces.
        var intCtr=0
        for(intCtr=0;str1.charAt(intCtr)==" ";intCtr++);
        str1=str1.substring(intCtr,str1.length);
        return str1;    
}
//validate email
function emailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(elem.value.match(emailExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

//check form
 
	
function listForm(frm){


  //check for category
 var t=0;
var c=frm['subcat[]'];
for(var i=0;i<c.length;i++){
c[i].checked?t++:null;
}
if(t==0)
{
alert('Please Select a Category');
//document.getElementById("sub_cat").checked==false;
document.getElementById("sub_cat").focus();
return false;
}
//check for title
if ( trim(frm.title.value).length <= 0 ){
			alert("Title of Site is missing!.");
			frm.title.focus();
			return false;
	}
//check for web address
/*if ( trim(frm.webaddress.value).length <= 0 ){
			alert("Web Address is missing!.");
			frm.webaddress.focus();
			return false;
	}*/
//check for Site Description
if ( trim(frm.desc.value).length <= 0 ){
			alert("Site Description is missing!.");
			frm.desc.focus();
			return false;
	}
	//check for contact person
	if ( trim(frm.contactperson.value).length <= 0 ){
			alert("Contactperson name is missing!");
			frm.contactperson.focus();
			return false;
	}
//check for email
	if ( trim(frm.txiEmail.value).length <= 0 ){
			alert("Email is missing!");
			frm.txiEmail.focus();
			return false;
	}
//check for email validity.
/*	if ( emailValidator(trim(frm.txiEmail.value)) ) {
			alert("Email is not correct!");
			frm.txiEmail.focus();
			return false;
	}*/
//check for address
	if ( trim(frm.address.value).length <= 0 ){
			alert("Address is missing!");
			frm.address.focus();
			return false;
	}

//check for city
	if ( frm.country.value.length <= 0 ){
			alert("Country is missing!");
			frm.country.focus();
			return true;
	}
//check for state
	if ( frm.state.value.length <= 0 ){
			alert("State is missing!");
			frm.state.focus();
			return false;
	}

//check for ZipCOde
	if ( frm.zip.value.length <= 0 ){
			alert("Zip code is missing!");
			frm.zip.focus();
			return false;
	}
}

function set(){
    if ((document.dataform.realname.value == "")|| (document.dataform.email.value == "")|| (document.dataform.feedback.value == "") ){
        alert ("Please enter all the required fields");
        return (false);
}
//radiobutton
if( (document.dataform.Feedback_Type[0].checked)||(document.dataform.Feedback_Type[1].checked)||(document.dataform.Feedback_Type[2].checked))
{
}
else
{
	alert ("Please select the radio fields");
	return (false);
}

//email validation
if (document.dataform.email.value.indexOf("@") < 0) {
    alert("Entry in email field is invalid");
	document.dataform.email.focus();
	return (false);
}
emailarr = document.dataform.email.value.split("@");
if (emailarr[0].length == 0) {
    alert("Entry in  email field is invalid");
	document.dataform.email.focus();
	return false;
}
if (emailarr[1].length == 0) {
    alert("Entry in email field is invalid");
	document.dataform.email.focus();
	return false;
}
if (emailarr[1].length !=0) {
    if (emailarr[1].indexOf(".") == -1) {
	    alert("Entry in email field is invalid");
		document.dataform.email.focus();
		return false;
	}
    emailarrnext=emailarr[1].split(".");
	if (emailarrnext[0].length == 0) {
        alert("Entry in email field is invalid");
		document.dataform.email.focus();
		return false;
	}
					
    if (emailarrnext[1].length == 0) {
        alert("Entry in email field is invalid");
		document.dataform.email.focus();
		return false;
	}
}
// end of email validation
 
}
function catseg(){
    if ((document.dataform.realname.value == "")|| (document.dataform.email.value == "")|| (document.dataform.suggest.value == "") 
		|| (document.dataform.code_field.value == ""))
	{
        alert ("Please enter all the required fields");
        return (false);
}

//email validation
if (document.dataform.email.value.indexOf("@") < 0) {
    alert("Entry in email field is invalid");
	document.dataform.email.focus();
	return (false);
}
emailarr = document.dataform.email.value.split("@");
if (emailarr[0].length == 0) {
    alert("Entry in  email field is invalid");
	document.dataform.email.focus();
	return false;
}
if (emailarr[1].length == 0) {
    alert("Entry in email field is invalid");
	document.dataform.email.focus();
	return false;
}
if (emailarr[1].length !=0) {
    if (emailarr[1].indexOf(".") == -1) {
	    alert("Entry in email field is invalid");
		document.dataform.email.focus();
		return false;
	}
    emailarrnext=emailarr[1].split(".");
	if (emailarrnext[0].length == 0) {
        alert("Entry in email field is invalid");
		document.dataform.email.focus();
		return false;
	}
					
    if (emailarrnext[1].length == 0) {
        alert("Entry in email field is invalid");
		document.dataform.email.focus();
		return false;
	}
}
// end of email validation
 
}

function enquiry(){
    if ((document.dataform.realname.value == "")|| (document.dataform.email.value == "")|| (document.dataform.Description.value == "") ){
        alert ("Please enter all the required fields");

        return (false);
}

//email validation
if (document.dataform.email.value.indexOf("@") < 0) {
    alert("Entry in email field is invalid");
	document.dataform.email.focus();
	return (false);
}
emailarr = document.dataform.email.value.split("@");
if (emailarr[0].length == 0) {
    alert("Entry in  email field is invalid");
	document.dataform.email.focus();
	return false;
}
if (emailarr[1].length == 0) {
    alert("Entry in email field is invalid");
	document.dataform.email.focus();
	return false;
}
if (emailarr[1].length !=0) {
    if (emailarr[1].indexOf(".") == -1) {
	    alert("Entry in email field is invalid");
		document.dataform.email.focus();
		return false;
	}
    emailarrnext=emailarr[1].split(".");
	if (emailarrnext[0].length == 0) {
        alert("Entry in email field is invalid");
		document.dataform.email.focus();
		return false;
	}
					
    if (emailarrnext[1].length == 0) {
        alert("Entry in email field is invalid");
		document.dataform.email.focus();
		return false;
	}
}


// end of email validation
 
}

function checkfrm()
	{
	
	docf=document.getElementById("frm");
	if(docf.username.value=='')
	{
		alert("Please Enter Username");
		docf.username.focus();
		return false;
	}
		
	if(docf.password.value=='')
	{
		alert("Please enter your Password");
		docf.password.focus();
		return false;
	}
	return validate_form(docf);
	
}

function check_enquiryform()
{
	
	docf=document.getElementById("frm");
	
	if(docf.name.value=='')
	{
		alert("Please enter your Name");		
		docf.name.focus();
		return false;
	}
	
	if(docf.email.value=='')
	{
		alert("Please enter your Email ID");
		docf.email.focus();
		return false;
	}

	if(docf.query.value=='')
	{
		alert("Please enter your Query in Brief");
		docf.query.focus();
		return false;
	}

	
   
   return validate_form(docf);
	
}

function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2) 
  		{
  			alert(alerttxt);
  			return false;
  		}
		else 
		{
			return true;
		}
	}
	
}


function validate_form(thisform)
{
	with (thisform)
	{
		if (validate_email(email,"Not a valid e-mail address!")==false)
  		{
  			email.focus();
  			return false;
  		}
	}
	
}
function change_pass()
{
docf=document.frm;
	
	if(docf.o_pass.value=='')
	{
		alert("Please enter your old password");
		docf.o_pass.focus();
		return false;
	}
	if(docf.n_pass.value=='')
	{
		alert("Please enter your old password");
		docf.n_pass.focus();
		return false;
	}
	if(docf.n_pass.value!=docf.c_pass.value)
	{
		alert("Password does not match.Retype your Password");
		frm.n_pass.focus();
		return false;
	}
	

}
