/*This function changes action of the form and submits it to fetch_contacts.php*/
var id	=	0;

function fetchContacts()
{
	var contactString = "";
	var count		  =  0;
	
	for(var i = 0;i < document.getElementById("selContacts[]").options.length;i++)
	{
		if(document.getElementById("selContacts[]").options[i].selected)
		{
			if(count > 0)
			{
				contactString += ",";
			}
				contactString += document.getElementById("selContacts[]").options[i].text;
				count++;
		}
	}
	
	document.form1.txtTo.value = contactString;
}

/*This function will make all checkboxes on the form checked or unchecked*/

function checkAll(CheckBoxControl)
{
	if(CheckBoxControl.checked == true)   
	{
		var i = 0;
		var j = 0;
		
		for (i=0; i < document.forms[0].elements.length; i++) 
		{
			if(document.forms[0].elements[i].name == "chkbox" + j)
			{
				document.forms[0].elements[i].checked = true;
			}
			j++;
		}
	}
	
	else if(CheckBoxControl.checked == false)
	{
		var i = 0;
		var j = 0;
		
		for (i=0; i < document.forms[0].elements.length; i++) 
		{
			if(document.forms[0].elements[i].name == "chkbox" +j)
			{
				document.forms[0].elements[i].checked = false;
			}
			j++;
		}
	}
}

/*This function will make all checkboxes on the form checked or unchecked*/

function checkAllOneOne(CheckBoxControl)
{ 

	
	if(CheckBoxControl.checked == true)   
	{ 
		var i = 0;
		var j = 1;
		
		for (i=1; i < document.forms[0].elements.length; i++) 
		{	
			
			if(document.forms[0].elements[i].name == "chkbox" + j)
			{	
				document.forms[0].elements[i].checked = true;
				j++;
			}
		}
	}
	
	else if(CheckBoxControl.checked == false)
	{
		var i = 0;
		var j = 1;
		
		for (i=1; i < document.forms[0].elements.length; i++) 
		{
			if(document.forms[0].elements[i].name == "chkbox" +j)
			{
				document.forms[0].elements[i].checked = false;
				j++;
			}
		}
	}
}

/*This function will make all checkboxes on the form checked or unchecked*/

function checkAllOneOne1(CheckBoxControl)
{ 
	
	if(CheckBoxControl.checked == true)   
	{ 
		var i = 0;
		var j = 1;
		
		for (i=1; i < document.form1.elements.length; i++) 
		{	
			
			if(document.form1.elements[i].name == "chkbox" + j)
			{	
				document.form1.elements[i].checked = true;
				j++;
			}
		}
	}
	
	else if(CheckBoxControl.checked == false)
	{
		var i = 0;
		var j = 1;
		
		for (i=1; i < document.form1.elements.length; i++) 
		{
			if(document.form1.elements[i].name == "chkbox" +j)
			{
				document.form1.elements[i].checked = false;
				j++;
			}
		}
	}
}

/*This function will make all checkboxes on the form checked or unchecked*/






function checkAllOne(CheckBoxControl)
{
	if(CheckBoxControl.checked == true)   
	{
		var i = 0;
		var j = 1;
		for (i=1; i < document.forms[0].elements.length; i++) 
		{
//			alert (document.forms[0].elements[i].name + "==" + "chkbox" + j);
			if(document.forms[0].elements[i].name == "chkbox" + j)
			{
//				alert(document.forms[0].elements[i].name + "now checked");
				document.forms[0].elements[i].checked = true;
				j++;
			}
		}
	}
	
	else if(CheckBoxControl.checked == false)
	{
		var i = 0;
		var j = 1;
		
		for (i=1; i < document.forms[0].elements.length; i++) 
		{
//			alert (document.forms[0].elements[i].name + "==" + "chkbox" + j);
			if(document.forms[0].elements[i].name == "chkbox" +j)
			{
				document.forms[0].elements[i].checked = false;
				j++;
			}
		}
	}
}




function confirmCheckBoxes(flag)
{
	var frm;
	frm	=	this.form1;
	var intCount = document.getElementById("hid_Cont").value;
		
	for(i=0;i < intCount;i++)
	{
		if(document.getElementById("chkbox"+(i+1)).checked == true)
		{
			selected = true;
			break;
		}
		
		else
		{
			selected = false;
		}
	}
	
	if(!selected)
	{
		alert("No message selcted!");
		document.form1.elements(0).focus();
		return false;
	}
	
	/*if flag = 1 form shall be submited to delete_from_inbox.php page
	  if flag = 2 form shall be submited to delete_from_sent.php page 
	  if flag = 3 form shall be submited to delete_from_trash.php page
	*/
	
	if(flag == 1)	
	{
		document.form1.action = "delete_from_inbox.php";
		document.form1.submit(); 	
	}
	
	else if(flag == 2)	
	{
		document.form1.action = "delete_from_sent_items.php";
		document.form1.submit(); 	
	}
	
	else if(flag == 3)
	{
		document.form1.action = "delete_from_trash.php";
		document.form1.submit(); 	
	}	
	
}
//...............................................................................................  
function validate_Form_user()
{
	
	arrayVal	=	new Array();
		
	arrayVal[0]	=	document.getElementById("txt_fname").value;
	arrayVal[1]	=	document.getElementById("txt_mname").value;
	arrayVal[2]	=	document.getElementById("txt_lname").value;
	arrayVal[3]	=	document.getElementById("txt_address1").value;
	arrayVal[4]	=	document.getElementById("txt_address2").value;
	arrayVal[5]	=	document.getElementById("user_country").value;
	arrayVal[6]	=	document.getElementById("userstate").value;
	arrayVal[7]	=	document.getElementById("txt_city").value;
	arrayVal[8]	=	document.getElementById("txt_zipcode").value;
	arrayVal[9]	=	document.getElementById("txt_home_phone").value;
	arrayVal[10]=	document.getElementById("txt_cell_phone").value;
	arrayVal[11]=	document.getElementById("combo_time_zone").value;
	
	
	if(check_name(document.getElementById("txt_fname").value))
	{
		alert("Please enter your First Name");
		document.getElementById("txt_fname").value=""
		document.getElementById("txt_fname").focus();
		return false;
	}
	
	if(check_lname(document.getElementById("txt_lname").value ))
	{
		alert("Please enter your Last Name");
		document.getElementById("txt_lname").value=""
		document.getElementById("txt_lname").focus();
		return false;
	}
	
	if(check_address(document.getElementById("txt_address1").value))
	{
		alert("Please enter your Address 1");
		document.getElementById("txt_address1").value	="";
		document.getElementById("txt_address1").focus();
		return false;
	}
	
	if(document.getElementById("user_country").value == "")
	{
		alert("Please select the Country");
		document.getElementById("user_country").focus();
		return false;
	}
	
	if(document.getElementById("userstate").value == "")
	{
		alert("Please select the State");
		document.getElementById("userstate").focus();
		return false;
	}
	
	if(isvalid_exp1(document.getElementById("txt_city").value ))
		{
			alert("Enter the City Name");
			document.getElementById("txt_city").value	=""
			document.getElementById("txt_city").focus();
			return false;
		}
	
	if(check_zipcode(document.getElementById("txt_zipcode").value))
		{
			alert("Enter the Zip Code/Postal Code");
			document.getElementById("txt_zipcode").focus();
			return false;
		}
	user_info_on_popup(arrayVal);
	return true;
}	
//...............................................................................................  
function check_zipcode(str)
	{
		
		if(isNaN(str) || str=="")
			{
				return true;
			}
		else
			{
				return false;
			}
	}
//..............................	
function check_name(str)
	{
		var str1	=	new String ();
		str1		=	str;	
		var val		=	str1.length;
		
		if(isNaN(str1)==false)
			{
				return true;
			}
		else if (val==0)
			{
				return true;
			}
		else
			{
			return false;
			}
		
	}
//..............................	
function check_lname(str)
	{
		var str1	=	new String ();
		str1		=	str;	
		var val		=	str1.length;
		
		if(isNaN(str1)==false)
			{
				return true;
			}
		else if (val==0)
			{
				return true;
			}
		else
			{
			return false;
			}
		
	}
//..............................	
function check_address(str)
	{
		var str1	=	new String ();
		str1		=	str;	
		var val		=	str1.length;
		
		if(isNaN(str1)==false)
			{
				return true;
			}
		else if (val==0)
			{
				return true;
			}
		else
			{
			return false;
			}
		
	}
//..............................	

function isvalid_exp1(txt)
		{
var val	=	txt.match(/[0-9]+[abcdefghijklmnopqrstuvwxyz]+|[abcdefghijklmnopqrstuvwxyz]+[0-9]+ | [0-9]+/g);

var str1	=	new String ();
str1		=	txt;	
var val1	=	str1.length;
		if(val==null)
			{
					if(val1==0)
					{
						return true;
					}
				else if(txt==" ")
					{
						return true;
						
					}
				else if(isNaN(txt)==false)
					{
						return true;
					}
				else
					{
						return false;
					}
			}
		else
			{
				return true;
			}
		}
		
//...............................................................................................  
function valid_cetagory()
	{
		if(document.getElementById("combo_cat").value=="")
			{
				alert("Please select the category from Drop Down list");
				return false;
			}
		else
			{
				return true;
			}
			
	}
//...............................................................................................  
function validate_Form_employer()
{
	
	arrayVal	=	new Array();
		
	arrayVal[0]	=	document.getElementById("txt_fname").value;
	arrayVal[1]	=	document.getElementById("txt_lname").value;
	arrayVal[2]	=	document.getElementById("txt_company_name").value;
	if(document.getElementById("chk_notify").checked)
		{
			arrayVal[11]=	document.getElementById("chk_notify").value;
		}
	else
		{
			arrayVal[11]=	"";
		}
	if(check_name(document.getElementById("txt_fname").value))
	{
		alert("Please enter your First Name");
		document.getElementById("txt_fname").value="";
		document.getElementById("txt_fname").focus();
		return false;
	}
	
	if(check_lname(document.getElementById("txt_lname").value))
	{
		alert("Please enter your Last Name");
		document.getElementById("txt_lname").value	=	"";
		document.getElementById("txt_lname").focus();
		return false;
	}
	
	if(check_companyname(document.getElementById("txt_company_name").value))
	{
		alert("Please enter your Company Name");
		document.getElementById("txt_company_name").value	=	"";	
		document.getElementById("txt_company_name").focus();
		return false;
	}
	
	emply_info_on_popup(arrayVal);
	return true;
}	
//..............................	
function check_companyname(str)
	{
		var str1	=	new String ();
		str1		=	str;	
		var val		=	str1.length;
		
		if(isNaN(str1)==false)
			{
				return true;
			}
		else if (val==0)
			{
				return true;
			}
		else
			{
			return false;
			}
		
	}
function check_title(str)
	{
		var str1	=	new String ();
		str1		=	str;	
		var val		=	str1.length;
		
		if(isNaN(str1)==false)
			{
				return true;
			}
		else if (val==0)
			{
				return true;
			}
		else
			{
			return false;
			}
		
	}
//...............................................................................................  
function validate_billig_shipping()
{
	alert(document.getElementById("bill_txt_code").value);

	if(check_name(document.getElementById("bill_txt_name").value))
	{
		alert("Please enter your First Name");
		document.getElementById("bill_txt_name").focus();
		return false;
	}
	

	var email	=	document.getElementById('email').value;
	if(email=="")
		{
			alert("Please enter the Email");
			document.getElementById('email').focus();
			return false;
		}
	else
		{
			var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
			var address = email;
			if(reg.test(address) == false) 
				{
					alert('Invalid Email Address');
					document.getElementById('email').focus();
					return false;
				}
		}
	if(document.getElementById("address").value == "")
	{
		alert("Please select the Address");
		document.getElementById("address").focus();
		return false;
	}
	
	if(document.getElementById("city").value == "")
	{
		alert("Please select the City");
		document.getElementById("city").focus();
		return false;
	}
	if(document.getElementById("user_country").value == "")
	{
		alert("Please select the Country");
		document.getElementById("user_country").focus();
		return false;
	}
	if(document.getElementById("bill_txt_code").value=="")
		{
			alert("Enter the Zip Code");
			document.getElementById("bill_txt_code").focus();
			return false;
		}
	else
		{
			if(check_zipcode(document.getElementById("code").value ))
				{
					alert("Invalid the Zip Code");
					document.getElementById("code").focus();
					return false;
				}
		}
	
	if(document.getElementById("state").value=="")
		{
			alert("Enter the State");
			document.getElementById("state").focus();
			return false;
		}

	if(document.getElementById("phone").value=="")
		{
			alert("Enter the Phone");
			document.getElementById("phone").focus();
			return false;
		}
	else
		{
			
			var regexObj = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;

			if (!regexObj.test(document.getElementById("phone").value)) 
				{
    
					alert("Invalid the Phone");
					document.getElementById("phone").focus();
					return false;
				}
		}
	


	return true;
}	

//... validate...........................	
/**
 * DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		//alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		//alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		//alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		//alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		//alert("Please enter a valid date")
		return false
	}
return true
}

//.............................
		
function delete_cat()
{
	$var	= confirm("Are you sure to delete this category? \n if you delete this catrgory all records related \nto this category will be lost");
	if($var==true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function delete_exp()
{
	$var	= confirm("Are you sure to delete this exprience?");
	if($var==true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function delete_edu()
{
	$var	= confirm("Are you sure to delete this education?");
	if($var==true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function delete_cv1()
{
	$var	= confirm("Are you sure to delete this CV?");
	if($var==true)
	{
		delete_cv1()
	}
	else
	{
		return false;
	}
}
function delete_userall()
{
	$var	= confirm("Are you sure to delete these users?");
	if($var==true)
	{
		return true;
	}
	else
	{
		return false;
	}

}
function delete_cont()
{
	$var	= confirm("Are you sure to delete this user?");
	if($var==true)
	{
		return true;
	}
	else
	{
		return false;
	}

}
function delete_reviews()
{
	$var	= confirm("Are you sure to delete this ?");
	if($var==true)
	{
		return true;
	}
	else
	{
		return false;
	}

}
function delete_pic()
{
	$var	= confirm("Are you sure to delete this Picture?");
	if($var==true)
	{
		return true;
	}
	else
	{
		return false;
	}

}
//...............................
function delete_category()
{
	$var	= confirm("Are you sure to delete this Category?");
	if($var==true)
	{
		return true;
	}
	else
	{
		return false;
	}

}
//.................................
function delete_Contents()
{
	$var	= confirm("Are you sure to delete this Record?");
	if($var==true)
	{
		return true;
	}
	else
	{
		return false;
	}

}
//.................................
function delete_fit_profile()
{
	$var	= confirm("Are you sure to delete this Fit Profile ?\n If you deleted this profile all the records having this profile will be deleted \n like from Cart and order in progess");
	if($var==true)
	{
		return true;
	}
	else
	{
		return false;
	}

}

//.................................
function delete_selected_rocords()
{
	$var	= confirm("Are you sure to delete these Records?");
	if($var==true)
	{
		return true;
	}
	else
	{
		return false;
	}

}

//.................................
function confirm_deletionForCompany(str)
{
	$var	= confirm("Are you sure to delete this Company\n If you delete this Company All the Jobs\n related to this will be delete Automatically?");
	if($var==true)
	{
		deleteComp(str);
	}
	else
	{
		showCompanies();
	}

}

//.................................
function delete_postedjobs()
{
	$var	= confirm("Are you sure to delete this Record?");
	if($var==true)
	{
		return true;
		
	}
	else
	{
		return false;
		
	}

}

//.................................
function delete_MoreContents()
{
	$var	= confirm("Are you sure to delete these Records?");
	if($var==true)
	{
		return true;
	}
	else
	{
		return false;
	}

}

//..............................................
function hideDiv(str) { 
if (document.getElementById) { // DOM3 = IE5, NS6 
document.getElementById(str).style.display = 'none'; 
} 
//else { 
//if (document.layers) { // Netscape 4 
//document.hideshow.visibility = 'hidden'; 
//
//} 
//else { // IE 4 
//document.all.hideshow.style.visibility = 'hidden'; 
//
//} 
//} 
}
//..............................................
function showDiv(str) 
{ 
	if (document.getElementById) 
	{ // DOM3 = IE5, NS6 
		
		document.getElementById(str).style.display = 'block'; 
	} 
/*else { 
if (document.layers) { // Netscape 4 
document.hideshow.visibility = 'visible'; 
} 
else { // IE 4 
document.all.hideshow.style.visibility = 'visible'; 
} 
} 
*/} 
//....................ajax for combox.........................
var xmlHttp;
//.......................................................................................
function hide_form1(str)
	{
		hideDiv(str);
		window.location="index.php"
	}
//.......................................................................................
function hide_form2(str)
	{
		hideDiv(str);
		window.location="funny_pics.php"
	}
//.......................................................................................
function hide_form(str)
	{
		hideDiv(str);
	}

//.......................................................................................
function disable_textbox(val,str)
	{
		if(val!="")
			{
				document.getElementById(str).disabled=true;
			}
		else
			{
				document.getElementById(str).disabled=false;
			}
	}
//.......................................................................................
function check_words(str,str1,allowed)
	{
		var word_count	= new String();
		var arrary 		= new Array();
		var i	=	0;
		word_count		=	document.getElementById(str).value;
		var arrary		=	word_count.split(" ");
		var count		=	arrary.length;

		if(count<allowed+1)
			{
				
				var remining_words	=	allowed - count;
				
				document.getElementById(str1).innerHTML	=	remining_words;
			
			}
		else
			{
				var ad	=	"";
				while(i<allowed)
					{
						ad	=	ad+arrary[i];
						ad	=	ad+" ";	
						i++;
					}
				
				document.getElementById(str).value	=	ad;
				
				document.getElementById(str1).innerHTML	=	0;
		
			}
	}
//............................................................................
function show_registration_form(str)
	{ 
		
		$(document).ready(function() {
	
		if(str==1)
			{
				data="flg=regist_form";
			}
		else
			{
				data="flg=regist_form2";
			}
		
		$.ajax({
			//this is the php file that processes the data and send mail
			url: "get_state.php",	
			
			//GET method is used
			type: "GET",

			//pass the data			
			data: data,		
			
			//Do not cache the page
			cache: false,
			
			//success
			success: function (html) {		
			
			$("#regist_pop").html(html);
			$("#regist_pop").show();
							
			}		
			   });						   
		
		
		});
		
		
		
		 
	}
//............................................................................
function show_registration_form1(str)
	{ 
		
		//id	=	str;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
			
		var url="get_state.php";
		if(str==1)
			{
				url=url+"?flg=regist_form";
			}
		else
			{
				url=url+"?flg=regist_form2";
			}
		
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForshow_registration_form;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForshow_registration_form() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert(xmlHttp.responseText);
				document.getElementById("regist_pop").innerHTML=xmlHttp.responseText;
				showDiv('regist_pop');
			} 
	}
//............................................................................
function show_product_img(str)
	{ 
		id	=	str;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=show_product_img"+"&pro_id="+id;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForshow_product_img;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForshow_product_img() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				document.getElementById("product_image").innerHTML=xmlHttp.responseText;
				show_product_detail(id);
			} 
	}
//............................................................................
function edit_product_img(str)
	{ 
		id	=	str;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=edit_product_img"+"&pro_id="+id;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForedit_product_img;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForedit_product_img() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				document.getElementById("product_image").innerHTML=xmlHttp.responseText;
				edit_product_detail(id);
			} 
	}

//.......................................................................................
function show_product_detail(str)
	{ 
		id	=	str;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=show_product_detail"+"&pro_id="+id;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForshow_product_detail;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForshow_product_detail() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				document.getElementById("fabric_detail").innerHTML=xmlHttp.responseText;
			} 
	}
//.......................................................................................
function edit_product_detail(str)
	{ 
		id	=	str;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=edit_product_detail"+"&pro_id="+id;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForedit_product_detail;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForedit_product_detail() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				document.getElementById("fabric_detail").innerHTML=xmlHttp.responseText;
			} 
	}
//.......................................................................................
function set_cookie_for_menu(str,str1)
	{
		
		date = new Date();
		date.setTime(date.getTime() + (1000 * 60 * 60 * 24 * 30)); 
		document.cookie = str + "=" + str1 + "; expires=" + date.toGMTString(); 
		
	}
//.......................................................................................
function show_hide_menu(str)
	{
		if(str=='weave')
			{
				if(document.getElementById('weave').style.display=='none')
					{
						document.getElementById('weave').style.display='block';
						document.getElementById('price').style.display='none';
						document.getElementById('design').style.display='none';
						
						document.getElementById('span_weave').className='arrow';
						document.getElementById('span_price').className='arrow2';
						document.getElementById('span_design').className='arrow2';
						set_cookie_for_menu('blue_menu','weave-block');
						
					}
				else
					{
						document.getElementById('weave').style.display='none';
						document.getElementById('price').style.display='none';
						document.getElementById('design').style.display='none';
						
						document.getElementById('span_weave').className='arrow2';
						document.getElementById('span_price').className='arrow2';
						document.getElementById('span_design').className='arrow2';
						set_cookie_for_menu('blue_menu','weave-none');
					}
					
				
			}
			
		if(str=='price')
			{
				if(document.getElementById('price').style.display=='none')
					{
						//document.getElementById('weave').style.display='none';
						document.getElementById('price').style.display='block';
						//document.getElementById('design').style.display='none';
						
						//document.getElementById('span_weave').className='arrow2';
						document.getElementById('price_a').className='active';
						document.getElementById('des_a').className='';
						document.getElementById('span_price').className='arrow';
						//document.getElementById('span_design').className='arrow2';
						set_cookie_for_menu('blue_menu','price-block');
					}
				else
					{
						//document.getElementById('weave').style.display='none';
						document.getElementById('price').style.display='none';
						//document.getElementById('design').style.display='none';
						
						//document.getElementById('span_weave').className='arrow2';
						document.getElementById('price_a').className='';
						document.getElementById('span_price').className='arrow2';
						//document.getElementById('span_design').className='arrow2';
						set_cookie_for_menu('blue_menu','price-none');
					}
			}
			
		if(str=='design')
			{
				if(document.getElementById('design').style.display=='none')
					{
						//document.getElementById('weave').style.display='none';
						//document.getElementById('price').style.display='none';
						document.getElementById('design').style.display='block';
						
						//document.getElementById('span_weave').className='arrow2';
						document.getElementById('des_a').className='active';
						document.getElementById('price_a').className='';
						document.getElementById('span_design').className='arrow';
						set_cookie_for_menu('blue_menu','design-block');
					}
				else
					{
						//document.getElementById('weave').style.display='none';
						//document.getElementById('price').style.display='none';
						document.getElementById('design').style.display='none';
						
						//document.getElementById('span_weave').className='arrow2';
						//document.getElementById('span_price').className='arrow2';
						document.getElementById('des_a').className='';
						document.getElementById('span_design').className='arrow2';
						set_cookie_for_menu('blue_menu','design-none');
					}
			}
	}
//.......................................................................................
function show_hide_menu1(str)
	{
		if(str=='settings')
			{
				if(document.getElementById('settings').style.display=='none')
					{
						document.getElementById('settings').style.display='block';
						document.getElementById('History').style.display='none';
						document.getElementById('Process').style.display='none';
						document.getElementById('Profile').style.display='none';
						document.getElementById('Track_order').style.display='none';
						
						document.getElementById('span_settings').className='arrow';
						document.getElementById('span_History').className='arrow2';
						document.getElementById('span_Process').className='arrow2';
						document.getElementById('span_Profile').className='arrow2';
						
						set_cookie_for_menu('blue_menu_second','settings-block');
						
					}
				else
					{
						document.getElementById('settings').style.display='none';
						document.getElementById('History').style.display='none';
						document.getElementById('Process').style.display='none';
						document.getElementById('Profile').style.display='none';
						document.getElementById('Track_order').style.display='none';
						
						document.getElementById('span_settings').className='arrow2';
						document.getElementById('span_History').className='arrow2';
						document.getElementById('span_Process').className='arrow2';
						document.getElementById('span_Profile').className='arrow2';
						
						set_cookie_for_menu('blue_menu_second','settings-none');
					}
					
				
			}
		
		if(str=='History')
			{
				if(document.getElementById('History').style.display=='none')
					{
						document.getElementById('settings').style.display='none';
						document.getElementById('History').style.display='block';
						document.getElementById('Process').style.display='none';
						document.getElementById('Profile').style.display='none';
						document.getElementById('Track_order').style.display='none';
						
						document.getElementById('span_settings').className='arrow2';
						document.getElementById('span_History').className='arrow';
						document.getElementById('span_Process').className='arrow2';
						document.getElementById('span_Profile').className='arrow2';
						
						set_cookie_for_menu('blue_menu_second','History-block');
						
					}
				else
					{
						document.getElementById('settings').style.display='none';
						document.getElementById('History').style.display='none';
						document.getElementById('Process').style.display='none';
						document.getElementById('Profile').style.display='none';
						document.getElementById('Track_order').style.display='none';
						
						document.getElementById('span_settings').className='arrow2';
						document.getElementById('span_History').className='arrow2';
						document.getElementById('span_Process').className='arrow2';
						document.getElementById('span_Profile').className='arrow2';
						
						set_cookie_for_menu('blue_menu_second','History-none');
					}
					
				
			}
			
			if(str=='Process')
					{
						if(document.getElementById('Process').style.display=='none')
							{
								document.getElementById('settings').style.display='none';
								document.getElementById('History').style.display='none';
								document.getElementById('Process').style.display='block';
								document.getElementById('Profile').style.display='none';
								document.getElementById('Track_order').style.display='none';
								
								document.getElementById('span_settings').className='arrow2';
								document.getElementById('span_History').className='arrow2';
								document.getElementById('span_Process').className='arrow';
								document.getElementById('span_Profile').className='arrow2';
								document.getElementById('span_Track_order').className='arrow2';
								
								set_cookie_for_menu('blue_menu_second','Process-block');
								
							}
						else
							{
								document.getElementById('settings').style.display='none';
								document.getElementById('History').style.display='none';
								document.getElementById('Process').style.display='none';
								document.getElementById('Profile').style.display='none';
								document.getElementById('Track_order').style.display='none';
								
								document.getElementById('span_settings').className='arrow2';
								document.getElementById('span_History').className='arrow2';
								document.getElementById('span_Process').className='arrow2';
								document.getElementById('span_Profile').className='arrow2';
								document.getElementById('span_Track_order').className='arrow2';
								
								set_cookie_for_menu('blue_menu_second','Process-none');
							}
					
			}
				if(str=='Profile')
					{
						if(document.getElementById('Profile').style.display=='none')
							{
								document.getElementById('settings').style.display='none';
								document.getElementById('History').style.display='none';
								document.getElementById('Process').style.display='none';
								document.getElementById('Profile').style.display='block';
								document.getElementById('Track_order').style.display='none';
								
								document.getElementById('span_settings').className='arrow2';
								document.getElementById('span_History').className='arrow2';
								document.getElementById('span_Process').className='arrow2';
								document.getElementById('span_Profile').className='arrow';
								document.getElementById('span_Track_order').className='arrow2';
								
								set_cookie_for_menu('blue_menu_second','Profile-block');
								
							}
						else
							{
								document.getElementById('settings').style.display='none';
								document.getElementById('History').style.display='none';
								document.getElementById('Process').style.display='none';
								document.getElementById('Profile').style.display='none';
								document.getElementById('Track_order').style.display='none';
								
								document.getElementById('span_settings').className='arrow2';
								document.getElementById('span_History').className='arrow2';
								document.getElementById('span_Process').className='arrow2';
								document.getElementById('span_Profile').className='arrow2';
								document.getElementById('span_Track_order').className='arrow2';
								
								set_cookie_for_menu('blue_menu_second','Profile-none');
							}
					
			}

		if(str=='Track_order')
					{
						if(document.getElementById('Track_order').style.display=='none')
							{
								document.getElementById('settings').style.display='none';
								document.getElementById('History').style.display='none';
								document.getElementById('Process').style.display='none';
								document.getElementById('Profile').style.display='none';
								document.getElementById('Track_order').style.display='block';
								
								document.getElementById('span_settings').className='arrow2';
								document.getElementById('span_History').className='arrow2';
								document.getElementById('span_Process').className='arrow2';
								document.getElementById('span_Profile').className='arrow2';
								document.getElementById('span_Track_order').className='arrow';
								
								set_cookie_for_menu('blue_menu_second','Track_order-block');
								
							}
						else
							{
								document.getElementById('settings').style.display='none';
								document.getElementById('History').style.display='none';
								document.getElementById('Process').style.display='none';
								document.getElementById('Profile').style.display='none';
								document.getElementById('Track_order').style.display='none';
								
								document.getElementById('span_settings').className='arrow2';
								document.getElementById('span_History').className='arrow2';
								document.getElementById('span_Process').className='arrow2';
								document.getElementById('span_Profile').className='arrow2';
								document.getElementById('span_Track_order').className='arrow2';
								
								set_cookie_for_menu('blue_menu_second','Track_order-none');
							}
					
			}		
	}
	
//.......................................................................................
function validate(form_id,email) 
	{
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = document.forms[form_id].elements[email].value;
   if(reg.test(address) == false) 
   {
      alert('Invalid Email Address');
      return false;
   }
}
//.......................................................................................
function validation_keep_touch()
	{
		  
		  var email	=	document.getElementById('email').value;
		  var zip	=	document.getElementById('zip').value;
		  //........................................................
		  if(email!="")
		  	{
				var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
  		  		var address = email;
				if(reg.test(address) == false) 
				   {
					  alert('Invalid Email Address');
					  return false;
				   }
			}
		else
			{
				alert('Enter Email Address');
				 return false;
			}
		//........................................................
		if(zip!="")
		  	{
				if(check_zipcode(zip)==true)
					{
						alert('Invalid Zip code ');
				 		return false;
					}
				
			}
		else
			{
				
				alert('Enter Zip code ');
				 return false;
			
			}
		 return true;
	}
//.......................................................................................
function valide_collars()
{
	var colr	=	false;
	var stic	=	false;
	
	var rad = document.from_collar.rad_colar;
	//alert("sdfsd");
	
		for(var i = 0; i < rad.length; i++)
		{
			if(rad[i].checked)
			{
				colr= true;
			}
				
		}
	if(!colr)
		{
		alert("Please select the collar first..");
		return false;
		}
	//.................................................................
	var rad = document.from_collar.rad_stich;
	//alert("sdfsd");
	
		for(var i = 0; i < rad.length; i++)
		{
			if(rad[i].checked)
			{
				stic= true;
			}
				
		}
	if(!stic)
		{
		alert("Please select the Collar stitching first..");
		return false;
		}
	
}
//.......................................................................................
function valide_front()
{
	var front	=	false;
	
	var rad = document.from_front.rad_front;
	//alert("sdfsd");
	
		for(var i = 0; i < rad.length; i++)
		{
			if(rad[i].checked)
			{
				front= true;
			}
				
		}
	if(!front)
		{
		alert("Please select the Front first..");
		return false;
		}
	
}
//.......................................................................................
function valide_back()
{
	var front	=	false;
	
	var rad = document.from_back.rad_back;
	//alert("sdfsd");
	
		for(var i = 0; i < rad.length; i++)
		{
			if(rad[i].checked)
			{
				front= true;
			}
				
		}
	if(!front)
		{
		alert("Please select the Back first..");
		return false;
		}
	
}
//.......................................................................................
function valide_cuffs()
{
	var front	=	false;
	
	var rad = document.from_cuff.rad_cuffs;
	//alert("sdfsd");
	
		for(var i = 0; i < rad.length; i++)
		{
			if(rad[i].checked)
			{
				front= true;
			}
				
		}
	if(!front)
		{
		alert("Please select the Cuffs first..");
		return false;
		}
	
}
//.......................................................................................
function valide_pockets()
{
	var front	=	false;
	
	if(document.getElementById('want_pocket').value==1)
		{
			var rad = document.from_pocket.rad_pocket;
			//alert("sdfsd");
			
				for(var i = 0; i < rad.length; i++)
					{
						if(rad[i].checked)
						{
							front= true;
						}
						
					}
					
				if(!front)
					{
						alert("Please select the Pocket first..");
						return false;
					}
		}
	
}
//.......................................................................................
function valide_mono()
{
	var front	=	false;
	
	if(document.getElementById('want_mono').value==1)
		{
			$mono_initial	=	document.getElementById('mono_initial').value;
			if($mono_initial=="")
				{
					alert("Please enter the monogram initial");
					return false;
				}
			var rad = document.from_mono.rad_mono;
			//alert("sdfsd");
			
				for(var i = 0; i < rad.length; i++)
				{
					if(rad[i].checked)
					{
						front= true;
					}
						
				}
			if(!front)
				{
				alert("Please select the Pocket first..");
				return false;
				}
		}
	
}
//.......................................................................................
function valide_fit_form()
{
	var front			=	false;
	var upper_body		=	false;
	var rad_mid_se		=	false;
	var rad_pre_fit		=	false;
	var txt_file_name	=	false;
	
	var Height	=	document.getElementById('Height').value;
	
	if(Height=="")
		{
			alert("Please enter the Height ");
			document.getElementById('Height').focus();
			return false;
		}
	
	var Weight	=	document.getElementById('Weight').value;
	
	if(Weight=="")
		{
			alert("Please enter the Weight ");
			document.getElementById('Weight').focus();
			return false;
		}
	
	var Initials	=	document.getElementById('Initials').value;
	
	if(Initials=="")
		{
			alert("Please enter the Initials ");
			document.getElementById('Initials').focus();
			return false;
		}
	
	var watch_hand	=	document.getElementById('watch_hand').value;
	
	if(watch_hand=="")
		{
			alert("Please enter the Watch Hand ");
			document.getElementById('watch_hand').focus();
			return false;
		}
		
	var WatchSize	=	document.getElementById('WatchSize').value;
	if(WatchSize=="")
		{
			alert("Please enter the Watch Size ");
			document.getElementById('WatchSize').focus();
			return false;
		}

	var Neck	=	document.getElementById('Neck').value;
	if(Neck=="")
		{
			alert("Please enter the Neck ");
			document.getElementById('Neck').focus();
			return false;
		}
	
	var Chest	=	document.getElementById('Chest').value;
	if(Chest=="")
		{
			alert("Please enter the Chest ");
			document.getElementById('Chest').focus();
			return false;
		}

	var Abdomon	=	document.getElementById('Abdomon').value;
	if(Abdomon=="")
		{
			alert("Please enter the Abdomon ");
			document.getElementById('Abdomon').focus();
			return false;
		}

	var Waist	=	document.getElementById('Waist').value;
	if(Waist=="")
		{
			alert("Please enter the Waist ");
			document.getElementById('Waist').focus();
			return false;
		}
	
	var Hips	=	document.getElementById('Hips').value;
	if(Hips=="")
		{
			alert("Please enter the Hips ");
			document.getElementById('Hips').focus();
			return false;
		}

	var Shoulder	=	document.getElementById('Shoulder').value;
	if(Shoulder=="")
		{
			alert("Please enter the Shoulder ");
			document.getElementById('Shoulder').focus();
			return false;
		}
	
	var Sleves	=	document.getElementById('Sleves').value;
	if(Sleves=="")
		{
			alert("Please enter the Sleves ");
			document.getElementById('Sleves').focus();
			return false;
		}
	
	var Biceps	=	document.getElementById('Biceps').value;
	if(Biceps=="")
		{
			alert("Please enter the Biceps ");
			document.getElementById('Biceps').focus();
			return false;
		}
	
	var Wrist	=	document.getElementById('Wrist').value;
	if(Wrist=="")
		{
			alert("Please enter the Wrist ");
			document.getElementById('Wrist').focus();
			return false;
		}

	var Length	=	document.getElementById('Length').value;
	if(Length=="")
		{
			alert("Please enter the Length ");
			document.getElementById('Length').focus();
			return false;
		}

	var rad = document.from_fit.rad_sh_neck;
	//alert("sdfsd");
	
		for(var i = 0; i < rad.length; i++)
		{
			if(rad[i].checked)
			{
				front= true;
			}
				
		}
	if(!front)
		{
		alert("Please select the Shoulder and Neck");
		return false;
		}
	//...........................................
	var rad = document.from_fit.rad_up_body;
	for(var i = 0; i < rad.length; i++)
		{
			if(rad[i].checked)
			{
				upper_body= true;
			}
				
		}
	if(!upper_body)
		{
		alert("Please select the Upper Body");
		return false;
		}

//...........................................
	var rad = document.from_fit.rad_mid_se;
	for(var i = 0; i < rad.length; i++)
		{
			if(rad[i].checked)
			{
				rad_mid_se= true;
			}
				
		}
	if(!rad_mid_se)
		{
		alert("Please select the Mid Section");
		return false;
		}
//...........................................
	var rad = document.from_fit.rad_pre_fit;
	for(var i = 0; i < rad.length; i++)
		{
			if(rad[i].checked)
			{
				rad_pre_fit= true;
			}
				
		}
	if(!rad_pre_fit)
		{
		alert("Please select the Preferred Fit");
		return false;
		}
//...........................................
var Length	=	document.getElementById('txt_file_name').value;
if(Length=="")
		{
			alert("Please enter the Profile Name");
			document.getElementById('txt_file_name').focus();
			return false;
		}
	}
//............................................................................
function show_help_pop($height,flg)
	{ 
	
		id	=	$height;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg="+flg;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForshow_help_pop;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForshow_help_pop() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				document.getElementById("help_pop_up").innerHTML=xmlHttp.responseText;
				document.getElementById("help_pop_up").style.top=id+'px';
				hideDiv('com_pop');
				showDiv('help_pop_up');
			} 
	}
//............................................................................
function show_comments($height)
	{ 
		id	=	$height;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=help_comments_up";
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForshow_comments_pop;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForshow_comments_pop() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				document.getElementById("com_pop").innerHTML=xmlHttp.responseText;
				document.getElementById("com_pop").style.top=id+'px';
				hideDiv('help_pop_up');
				showDiv('com_pop');
				
			} 
	}
//............................................................................
function show_collar_style(str)
	{ 
		//id	=	$height;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=show_collar&id="+str;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForshow_collar_style;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForshow_collar_style() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				document.getElementById("col_style").innerHTML=xmlHttp.responseText;
				//document.getElementById("com_pop").style.top=id+'%';
			
				
			} 
	}
//............................................................................
function show_collar_stitch(str)
	{ 
		//id	=	$height;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=show_stitch&id="+str;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForshow_collar_stitch;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForshow_collar_stitch() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				document.getElementById("col_stitch").innerHTML=xmlHttp.responseText;
				//document.getElementById("com_pop").style.top=id+'%';
			
				
			} 
	}
//............................................................................
function show_front_style(str)
	{ 
		//id	=	$height;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=show_front&id="+str;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForshow_front_style;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForshow_front_style() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				document.getElementById("front_style").innerHTML=xmlHttp.responseText;
				//document.getElementById("com_pop").style.top=id+'%';
			
				
			} 
	}
//............................................................................
function show_back_style(str)
	{ 
		//id	=	$height;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=show_back&id="+str;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForshow_back_style;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForshow_back_style() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				document.getElementById("back_style").innerHTML=xmlHttp.responseText;
				//document.getElementById("com_pop").style.top=id+'%';
			
				
			} 
	}
//............................................................................
function show_cuffs_style(str)
	{ 
		//id	=	$height;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=show_cuff&id="+str;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForshow_cuffs_style;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForshow_cuffs_style() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				document.getElementById("cuffs_style").innerHTML=xmlHttp.responseText;
				//document.getElementById("com_pop").style.top=id+'%';
			
				
			} 
	}
//............................................................................
function show_pockets_style(str)
	{ 
		//id	=	$height;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=show_pocket&id="+str;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForshow_pockets_style;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForshow_pockets_style() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				document.getElementById("pocket_style").innerHTML=xmlHttp.responseText;
				//document.getElementById("com_pop").style.top=id+'%';
			
				
			} 
	}
//............................................................................
function show_mono_style(str)
	{ 
		//id	=	$height;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=show_mono&id="+str;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForshow_mono_style;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForshow_mono_style() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				document.getElementById("mono_style").innerHTML=xmlHttp.responseText;
				//document.getElementById("com_pop").style.top=id+'%';
			
				
			} 
	}
//............................................................................
function show_fit(str)
	{ 
		//id	=	$height;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=show_fit&id="+str;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForshow_mono_style;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForshow_mono_style() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				document.getElementById("mono_style").innerHTML=xmlHttp.responseText;
				//document.getElementById("com_pop").style.top=id+'%';
			
				
			} 
	}
//............................................................................
function show_larg_viewer(str)
	{ 
		//alert(str);
		//id	=	$height;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=show_larg_viewer&id="+str;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForshow_larg_viewer;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForshow_larg_viewer() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				document.getElementById("lg_pic_fu").innerHTML=xmlHttp.responseText;
				showDiv('large_img_viewer');
			
				
			} 
	}
//............................................................................
function show_video_viewer(str)
	{ 
		//document.getElementById(str).style.visibility = 'visible';
		showDiv(str);
	}
//.......................................................................................
function check_contrast()
	{ 
	var flag = '';
		if(document.getElementById("collar_contrast").checked==true)
				{
					document.getElementById("col_contrast").innerHTML	=	'Contrasting';
					flag = 1;
				}
			else
				{
					document.getElementById("col_contrast").innerHTML	=	'';
					flag = 0;
				}
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=check_collar_contrast&flag="+flag;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForshow_collar_contrast;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}

function stateChangedForshow_collar_contrast() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
				//document.getElementById("col_style").innerHTML=xmlHttp.responseText;
			} 
	}
//.......................................................................................
function cuffss_contrast()
	{ 
		var flag = '';
		
		if(document.getElementById("cuff_contrast").checked==true)
			{
				document.getElementById("col_cuf_contrast").innerHTML	=	'Contrasting';
				flag = 1;
			}
		else
			{
				document.getElementById("col_cuf_contrast").innerHTML	=	'';
				flag = 0;
			}
			
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=check_cuff_contrast&flag="+flag;
		
		xmlHttp.onreadystatechange=stateChangedForshow_cuff_contrast;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}

function stateChangedForshow_cuff_contrast() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
				//document.getElementById("col_style").innerHTML=xmlHttp.responseText;
			} 
	}
//......................................................................................
function validate_singup_form()
	{

			var email	=	document.getElementById('txt_email').value;
			if(email=="")
				{
					alert("Please enter the Email ");
					document.getElementById('txt_email').focus();
					return false;
				}
			else
				{
					var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
					var address = email;
					if(reg.test(address) == false) 
					   {
						  alert('Invalid Email Address');
						  document.getElementById('txt_email').focus();
						  return false;
					   }
				}
			//.............................................................................
			var pass	=	document.getElementById('txt_pass').value;
			if(pass=="")
				{
					alert("Please enter the Password ");
					document.getElementById('txt_pass').focus();
					return false;
				}
			//.............................................................................
			var repass	=	document.getElementById('txt_re_pass').value;
			if(repass=="")
				{
					alert("Please Re-Type Password ");
					document.getElementById('txt_re_pass').focus();
					return false;
				}
			if(repass!=pass)
				{
					alert("Re-Type Password dosn't match");
					document.getElementById('txt_re_pass').focus();
					return false;
				}
			//.............................................................................
		register_customer();
	}
//......................................................................................
function validate_singup_form2()
	{

			var email	=	document.getElementById('txt_email').value;
			if(email=="")
				{
					alert("Please enter the Email ");
					document.getElementById('txt_email').focus();
					return false;
				}
			else
				{
					var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
					var address = email;
					if(reg.test(address) == false) 
					   {
						  alert('Invalid Email Address');
						  document.getElementById('txt_email').focus();
						  return false;
					   }
				}
			//.............................................................................
			var pass	=	document.getElementById('txt_pass').value;
			if(pass=="")
				{
					alert("Please enter the Password ");
					document.getElementById('txt_pass').focus();
					return false;
				}
			//.............................................................................
			var repass	=	document.getElementById('txt_re_pass').value;
			if(repass=="")
				{
					alert("Please Re-Type Password ");
					document.getElementById('txt_re_pass').focus();
					return false;
				}
			if(repass!=pass)
				{
					alert("Re-Type Password dosn't match");
					document.getElementById('txt_re_pass').focus();
					return false;
				}
			//.............................................................................
			register_customer2();
	}
//......................................................................................
function validateTourSheduleForm(app_id)
	{
		
			var firstName=	document.getElementById('txtFirstName').value;
			if(firstName=="")
				{
					alert("Select First Name ");
					document.getElementById('txtFirstName').focus();
					return false;
				}
			
			var lastName=	document.getElementById('txtLastName').value;
			if(lastName=="")
				{
					alert("Select Last Name ");
					document.getElementById('txtLastName').focus();
					return false;
				}
			//.............................................................................
			var email	=	document.getElementById('txtEmail').value;
			if(email=="")
				{
					alert("Please enter the Email ");
					document.getElementById('txtEmail').focus();
					return false;
				}
			else
				{
					var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
					var address = email;
					if(reg.test(address) == false) 
					   {
						  alert('Invalid Email Address');
						  document.getElementById('txtEmail').focus();
						  return false;
					   }
				}
			//.............................................................................
			var phone	=	document.getElementById('txtPhone').value;
			if(phone=="")
				{
					alert("Please enter the Phone");
					document.getElementById('txtPhone').focus();
					return false;
				}
			//.............................................................................
			var date	=	document.getElementById('txtDate').value;
			if(date=="")
				{
					alert("Please enter the Date");
					document.getElementById('txtDate').focus();
					return false;
				}
			//.............................................................................
			var time	=	document.getElementById('txtTime').value;
			if(time=="")
				{
					alert("Please enter the Time");
					document.getElementById('txtTime').focus();
					return false;
				}
			//.............................................................................
			var regarding	=	document.getElementById('txtRegarding').value;
			if(regarding=="")
				{
					alert("Please enter the Regarding Text");
					document.getElementById('txtRegarding').focus();
					return false;
				}
			//.............................................................................
			EmailForAppointment(app_id);

	}
//......................................................................................
function clearTourSheduleForm()
	{
		
			document.getElementById('txtFirstName').value	=	"";
			//.............................................................................
			document.getElementById('txtLastName').value	=	"";
			//.............................................................................
			document.getElementById('txtEmail').value 		=	"";
			//.............................................................................
			document.getElementById('txtPhone').value		=	"";
			//.............................................................................
			document.getElementById('txtDate').value		=	"";
			//.............................................................................
			document.getElementById('txtTime').value		=	"";
			//.............................................................................
			document.getElementById('txtRegarding').value	=	"";
			//.............................................................................
			return false;
	}
//......................................................................................
function validate_billing_shipping_form()
	{
			
			var name	=	document.getElementById('bill_txt_name').value;
			if(name=="")
				{
					alert("Please enter the Name for Billing");
					document.getElementById('bill_txt_name').focus();
					return false;
				}
			//.............................................................................
			var email	=	document.getElementById('bill_txt_emailaddress').value;
			if(email=="")
				{
					alert("Please enter the Email for Billing");
					document.getElementById('bill_txt_emailaddress').focus();
					return false;
				}
			else
				{
					var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
					var address = email;
					if(reg.test(address) == false) 
					   {
						  alert('Invalid Email Address for Billing');
						  document.getElementById('bill_txt_emailaddress').focus();
						  return false;
					   }
				}
			//.............................................................................
			var pass	=	document.getElementById('bill_txt_address').value;
			if(pass=="")
				{
					alert("Please enter the Address for Billing ");
					document.getElementById('bill_txt_address').focus();
					return false;
				}
			//.............................................................................
			
			if(document.getElementById("bill_phone").value=="")
				{
					alert("Enter Your Contact Phone Number");
					document.getElementById("bill_phone").focus();
					return false;
				}
			else
				{
					
					var regexObj = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;
		
					if (!regexObj.test(document.getElementById("bill_phone").value)) 
						{
			
							alert("Please enter both your billing and shipping contact phone numbers   (ex. 555-555-5555) ");
							document.getElementById("bill_phone").focus();
							return false;
						}
				}
			//.............................................................................
			var country	=	document.getElementById('user_country').value;
			if(country=="")
				{
					alert("Please enter the country for Billing ");
					document.getElementById('user_country').focus();
					return false;
				}
			//.............................................................................
			var city	=	document.getElementById('state').value;
			if(city=="")
				{
					alert("Please select the State ");
					document.getElementById('state').focus();
					return false;
				}
			//.............................................................................
			var city	=	document.getElementById('bill_txt_city').value;
			if(city=="")
				{
					alert("Please enter the City ");
					document.getElementById('bill_txt_city').focus();
					return false;
				}
			//.............................................................................
			
			if(document.getElementById("bill_txt_code").value=="")
				{
					alert("Enter the Zip Code");
					document.getElementById("bill_txt_code").focus();
					return false;
				}
			else
				{
					if(check_zipcode(document.getElementById("bill_txt_code").value ))
						{
							alert("Invalid the Zip Code");
							document.getElementById("bill_txt_code").focus();
							return false;
						}
				}
			//.............................................................................
			var country	=	document.getElementById('ship_txt_name').value;
			if(country=="")
				{
					alert("Select the Shipping Name");
					document.getElementById('ship_txt_name').focus();
					return false;
				}
			//.............................................................................
			var state	=	document.getElementById('ship_txt_address').value;
			if(state=="")
				{
					alert("Select the Shipping Address");
					document.getElementById('ship_txt_address').focus();
					return false;
				}
			//.............................................................................
			if(document.getElementById("bill_phone").value=="")
				{
					alert("Enter Your Contact Phone Number");
					document.getElementById("ship_phone").focus();
					return false;
				}
			else
				{
					
					var regexObj = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;
		
					if (!regexObj.test(document.getElementById("ship_phone").value)) 
						{
			
							alert("Please enter both your billing and shipping contact phone numbers   (ex. 555-555-5555) ");
							document.getElementById("ship_phone").focus();
							return false;
						}
				}
			//.............................................................................
			var country1	=	document.getElementById('user_country1').value;
			if(country1=="")
				{
					alert("Select the Country");
					document.getElementById('user_country1').focus();
					return false;
				}
			//.............................................................................
			var state1	=	document.getElementById('state1').value;
			if(state1=="")
				{
					alert("Select the State");
					document.getElementById('state1').focus();
					return false;
				}	
			//.............................................................................
			var city_shp	=	document.getElementById('ship_txt_city').value;
			if(city_shp=="")
				{
					alert("Enter the Shipping City");
					document.getElementById('ship_txt_city').focus();
					return false;
				}
			//.............................................................................
			if(document.getElementById("ship_txt_code").value=="")
				{
					alert("Enter the Shipping Zip Code");
					document.getElementById("ship_txt_code").focus();
					return false;
				}
			else
				{
					if(check_zipcode(document.getElementById("ship_txt_code").value ))
						{
							alert("Invalid the Shipping Zip Code");
							document.getElementById("ship_txt_code").focus();
							return false;
						}
				}
		return true;
			//.............................................................................
	}
//.......................................................................................
function show_state(str)
	{ 
		document.getElementById("txthint").innerHTML= 'Wait...<img src="images/loading.gif"  />';
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flag=state&q="+str;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChanged() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				document.getElementById("txthint").innerHTML=xmlHttp.responseText;
			} 
	}
//.......................................................................................
function show_state1(str)
	{ 
		document.getElementById("txthint").innerHTML= 'Wait...<img src="images/loading.gif"  />';
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flag=state1&q="+str;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedforshow_state1;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedforshow_state1() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				document.getElementById("txthint").innerHTML=xmlHttp.responseText;
			} 
	}
//.......................................................................................
function show_state2(str)
	{ 
		document.getElementById("txthint1").innerHTML= 'Wait...<img src="images/loading.gif"  />';
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flag=state2&q="+str;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedforshow_state2;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedforshow_state2() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				document.getElementById("txthint1").innerHTML=xmlHttp.responseText;
			} 
	}
//.......................................................................................
function check_cart(str)
	{ 
		if(str==1)
			{
				return true;
			}
		else
			{
				alert("Your Shopping Cart is Empty.");
				return false;
			}
		
	}
//.......................................................................................
function select_fabric()
	{
		
	//alert('dsdsdsd');
			alert("Click " +'"'+"Select Fabric"+'"'+ " button to add swatch to DesignCard. Click "+'"'+"Next Styles" + '"' + " to proceed to the "+'"'+"Styles" + '"' + " section");
		return false;	
		
	}
//..................................Show company Detail...........................................
function forgot_password()
	{ 
		//id	=	str;
		//alert(str);
		//document.getElementById("detail").innerHTML= '<img src="images/loading.gif"  />';
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=forgotpass";
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForForgotPassword;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForForgotPassword() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				
				document.getElementById("forgot_pass").innerHTML=xmlHttp.responseText;
				showDiv('forgot_pass');
			} 
	}
//..................................Show company Detail...........................................
function forgot_password_mail()
	{ 
		//id	=	str;
		//alert(str);
		var email_address	=	document.getElementById("email").value;
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		var url="get_state.php";
		url=url+"?flg=forgotpassMail&q="+email_address;
		//url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChangedForForgotPasswordEmail;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForForgotPasswordEmail() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
 				//alert("cat"+str);
				
				document.getElementById("forgot_pass").innerHTML=xmlHttp.responseText;
				showDiv('forgot_pass');
			} 
	}
//..................................Show company Detail...........................................
function replace_img(id,image)
	{ 
		/*if(image=='Sleeves-(0032).jpg')
			{
				document.getElementById('pic_title').innerHTML	=	"Picture # 1";
			}
		if(image=='Sleeves-(0038).jpg')
			{
				document.getElementById('pic_title').innerHTML	=	"Picture # 2";
			}
		if(image=='Sleeves-(0041).jpg')
			{
				document.getElementById('pic_title').innerHTML	=	"Picture # 3";
			}*/
		document.getElementById(id).innerHTML	=	' <a href="javascript:show_larg_viewer('+ "'"+image+ "'"+');"><img src="Fit/'+image+'"/></a>';
	}
//.......................................................................................
function submitScheduleForm()
	{
		document.frmSchedule.submit();
	}
//..................................Show company Detail...........................................
function ShowSchedulForm(appointId)
	{ 
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		
		var url="get_state.php";
		url=url+"?flg=ShowSchedulForm&id="+appointId;
		
		xmlHttp.onreadystatechange=stateChangedForShowSchedulForm;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
function stateChangedForShowSchedulForm() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 
				
				document.getElementById("apptId").innerHTML=xmlHttp.responseText;
				showDiv('apptId');
				
			} 
	}
//.......................................................................................
function valid_profile()
	{
		if(document.getElementById("combo_fit").value=="")
			{
					alert("If your a new customer please create a new fit profile, if you are a returning customer please select a fit profile and continue.");
					return false;
			}
		else
			{
				return true;
			}
		 
	}
//.......................................................................................
function check_data(fabric,collar,front,sback,pocket,cuff,mono,fit)
	{
		var str	=	String();
		if(fabric=='')
			{
				str	=	'Please select the fabric\n';
			}
		if(collar=='')
			{
				str	+=	'Please select the Collar\n';
			}
		if(front=='')
			{
				str	+=	'Please select the Front\n';
			}
		if(sback=='')
			{
				str	+=	'Please select the Back\n';
			}
		if(pocket=='')
			{
				str	+=	'Please select the Pocket\n';
			}
		if(cuff=='')
			{
				str	+=	'Please select the Cuff\n';
			}
		/*if(mono=='')
			{
				str	+=	'Please select the Monogram\n';
			}*/
		if(fit=='')
			{
				str	+=	'Please select the Fit\n';
			}
		
		if(str=='')
			{
				return true;
			}
		else
			{
				alert(str);
				return false;
			}

	}
//.......................................................................................
function GetXmlHttpObject()
	{
		var xmlHttp=null;
		try
 			{
 				// Firefox, Opera 8.0+, Safari
 				xmlHttp=new XMLHttpRequest();
 			}
		catch (e)
 			{
 				//Internet Explorer
 				try
  					{
 			 			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  					}
 				catch (e)
  					{
 			  			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  					}
	 		}
		return xmlHttp;
	}
	
// --------------------------- Coupon Functions ------------------------
function check_coupon()
{
	var text = document.getElementById("txt_coupon").value;
	var error_div = document.getElementById("coupon_div");
	
	if(text != 'customweek')
	{
		error_div.innerHTML = "The Coupon code is not valid";
		//alert("");
	}
	else
	{
		MakeRequestCoupon();
		//error_div.innerHTML = "You have now discount of 20%";
	}
}

//..................................Changing coupon Details...........................................
function MakeRequestCoupon()
	{ 

		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		
		var url="discount_coupon.php";
		
		xmlHttp.onreadystatechange=showResponseTextCoupon;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
	
function showResponseTextCoupon() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 

				//document.getElementById("coupon_div").innerHTML=xmlHttp.responseText;
				window.location.href = 'Cart.html';
				//showDiv('apptId');
				
			} 
	}
//-----------------------------------------------------------
function want_pocket_dpd()
{
	var val = document.getElementById('want_pocket').value;
	MakeRequestWantPocketDpd(val);
}

function MakeRequestWantPocketDpd(val)
	{ 

		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		
		var url="get_state.php";
		url=url+"?flg=want_pocket_dpd"+"&val="+val;
		
		xmlHttp.onreadystatechange=showResponseTextWantPocket;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
	
function showResponseTextWantPocket() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 

		  if(xmlHttp.responseText == 1)
			document.getElementById("coupon_div").innerHTML=xmlHttp.responseText;
		  else
			{
				document.getElementById("pocket_style").innerHTML = 'N/A';
			}
				//document.getElementById("coupon_div").innerHTML=xmlHttp.responseText;
				//alert(xmlHttp.responseText);
				//showDiv('apptId');
				
			} 
	}
//------------------------------------------------------------
function want_mono_dpd()
{
	var val = document.getElementById('want_mono').value;
	MakeRequestWantMonoDpd(val);
}

function MakeRequestWantMonoDpd(val)
	{ 

		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		
		var url="get_state.php";
		url=url+"?flg=want_mono_dpd"+"&val="+val;
		
		xmlHttp.onreadystatechange=showResponseTextWantMono;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
	
function showResponseTextWantMono() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 

			if(xmlHttp.responseText == 1)
				document.getElementById("coupon_div").innerHTML=xmlHttp.responseText;
			else
			{
				document.getElementById("mono_style").innerHTML = 'N/A';
				document.getElementById("change_mono_intails").innerHTML = '';
				document.getElementById("change_mono_postion").innerHTML = '';
				document.getElementById("mono_initial").value   = '';
			}
				//alert(xmlHttp.responseText);
				//showDiv('apptId');
				
			} 
	}
//-----------------------------------------------------------
function change_mono_intails()
{
	
	var text = document.getElementById("mono_initial").value;
	document.getElementById("change_mono_intails").innerHTML = text;
	MakeRequestChangeMonoIntails(text);
}

function MakeRequestChangeMonoIntails(val)
	{ 

		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		
		var url="get_state.php";
		url=url+"?flg=change_mono_intails"+"&val="+val;
		
		xmlHttp.onreadystatechange = showResponseTextChangeMonoIntails;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
	
function showResponseTextChangeMonoIntails() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 

				//alert(xmlHttp.responseText);
				//showDiv('apptId');
				
			} 
	}

//------------------------------------------------------------
function wana_mono_place()
{
	var val = document.getElementById('mono_postion').value;
	//alert(val);
	document.getElementById("change_mono_postion").innerHTML = val;
	MakeRequestMonoPlace(val);

}
function MakeRequestMonoPlace(val)
	{ 

		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
 			{
 				alert ("Browser does not support HTTP Request");
				 return;
		 	}
		
		var url="get_state.php";
		url=url+"?flg=wana_mono_place"+"&val="+val;
		
		xmlHttp.onreadystatechange = showResponseTextMonoPlace;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
	
function showResponseTextMonoPlace() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 			{ 

				//alert(xmlHttp.responseText);
				//showDiv('apptId');
				
			} 
	}
//----------------------------------------------

function ch_height(val)
{

	document.getElementById('divHeight').innerHTML = val;
}

//----------------------------------------------
function ch_weight(val)
{

	document.getElementById('divWeight').innerHTML = val +' lbs';
}

//----------------------------------------------
function ch_initials()
{

	document.getElementById('divInitials').innerHTML = document.getElementById('Initials').value;
}

//----------------------------------------------
function ch_watch_hand(val)
{

	document.getElementById('divWatch_Hand').innerHTML = val;
}
//----------------------------------------------
function ch_WatchSize(val)
{

	document.getElementById('divWatch_Size').innerHTML = val;
}

//----------------------------------------------
function ch_Neck(val)
{

	document.getElementById('divCollor').innerHTML = val +'"';
}

//----------------------------------------------
function ch_Chest(val)
{

	document.getElementById('divChest').innerHTML = val +'"';
}


//----------------------------------------------
function ch_Abdomen(val)
{

	document.getElementById('divAbdomen').innerHTML = val +'"';
}
//----------------------------------------------
function ch_Waist(val)
{

	document.getElementById('divWaist').innerHTML = val +'"';
}
//----------------------------------------------
function ch_Hips(val)
{

	document.getElementById('divHips').innerHTML = val +'"';
}

//----------------------------------------------
function ch_Hips(val)
{

	document.getElementById('divHips').innerHTML = val +'"';
}
//----------------------------------------------
function ch_Shoulder(val)
{

	document.getElementById('divShoulder').innerHTML = val +'"';
}
//----------------------------------------------
function ch_Sleves(val)
{

	document.getElementById('divRight_Sleeve').innerHTML = val +'"';
}

//----------------------------------------------
function ch_LeftSleves(val)
{

	document.getElementById('divLeft_Sleeve').innerHTML = val +'"';
}
//----------------------------------------------
function ch_Biceps(val)
{

	document.getElementById('divBiceps').innerHTML = val +'"';
}
//----------------------------------------------
function ch_Wrist(val)
{

	document.getElementById('divWrist').innerHTML = val +'"';
}
//----------------------------------------------
function ch_Length(val)
{

	document.getElementById('divLength').innerHTML = val +'"';
}

//----------------------------------------------
function ch_shou(val)
{

	document.getElementById('divShoulder1').innerHTML = val;
}

//----------------------------------------------
function ch_Chest2(val)
{

	document.getElementById('divChest2').innerHTML = val;
}
//----------------------------------------------
function ch_Abdomen2(val)
{

	document.getElementById('divAbdomen2').innerHTML = val;
}
//----------------------------------------------
function ch_Fit(val)
{

	document.getElementById('divFit').innerHTML = val;
}


