function detailsimage(){
	//alert('dd');
	document.getElementById('detailsimagetext').style.display='block';
}
function detailsimageoff(){
	//alert('dd');
	document.getElementById('detailsimagetext').style.display='none';
}
<!--bottom menu END -->

function formsubmit(){
//alert('d');	
document.stylesearch.submit();
}

function showcatdes(des){
	document.getElementById('catedes01').innerHTML = des;
}
function showcatdesoff(){
	//alert('d');
document.getElementById('catedes01').innerHTML ='<span class="catedes01">The Heritage story begins with the formation of A. JAFFE in 1892 and continues through the 20th and 21st centuries,threading landmark changes in bridal jewelry. The Heritage Collection highlights four periods of the company’s formative history, a truly breathtaking journey.</span>';
}

<!--fade start-->
var duration = 1000;
var steps = 20;
function setOpacity(level,id) {
  var elem = document.getElementById(id);
  elem.style.opacity = level;
  elem.style.filter = "alpha(opacity=" + (level * 100) + ");";
}
function fadeIn(id) {

  for (var i = 0; i <= 1; i += (1/steps)) {
    setTimeout("setOpacity(" + i + ","+id+")", i * duration);
  }
document.getElementById('showstyle'+id+'').style.display='block';
}
function showstylehide(id){
document.getElementById('showstyle'+id+'').style.display='none';
}

<!--fade end-->

<!--checking field start-->
//////////////////////////////EMAIL VALIDATION//////////////////////////////////////////////////////////
function the_mail(control_value)
{
		var emailStr = control_value;
		var emailPat=/^(.+)@(.+)$/
		var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
		var validChars="\[^\\s" + specialChars + "\]"
		var quotedUser="(\"[^\"]*\")"
		var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
		var atom=validChars + '+'
		var word="(" + atom + "|" + quotedUser + ")"
		var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
		var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
		var matchArray=emailStr.match(emailPat)
		if (matchArray==null) 
		{
			alert("Email address seems incorrect ");
			//eval("document."+form_name+"."+control_name).focus();
			return true;
		}
		var user=matchArray[1]
		var domain=matchArray[2]
		if (user.match(userPat)==null)
		{
			alert("The Email address doesn't seem to be valid.");
			//eval("document."+form_name+"."+control_name).focus();
			return true;
		}
		var IPArray=domain.match(ipDomainPat)
		if (IPArray!=null) 
		{
			for (var i=1;i<=4;i++) 
			{
				if (IPArray[i]>255) 
				{
					alert("Destination IP address is invalid!");
					//eval("document."+form_name+"."+control_name).focus();
					return true;
				}
			}
				 
		}
		var domainArray=domain.match(domainPat)
		if (domainArray==null) 
		{
			alert("The domain name doesn't seem to be valid.");
			//eval("document."+form_name+"."+control_name).focus();
			return true;
		}
		var atomPat=new RegExp(atom,"g")
		var domArr=domain.match(atomPat)
		var len=domArr.length
		if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) 
		{
			alert("The address must end in a three-letter domain, or two letter country.");
			//eval("document."+form_name+"."+control_name).focus();
			return true;
		}
		if (len<2) 
		{
			alert("This address is missing a hostname!");
			//eval("document."+form_name+"."+control_name).focus();
			return true;
		}
		return false;
	
}
///////////////////////////////////////////////////////////////////////////////////////////

function check_user(){
	var regBlank = /[^\s]/;
	var regBlank1=/[^\s]/;
var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";

if(!regBlank.test(document.registeruser.fname.value)){document.getElementById("fname").style.backgroundColor="#FF9393";return false;}	
if(!regBlank.test(document.registeruser.zip.value)){document.getElementById("zip").style.backgroundColor="#FF9393";return false;}	
if(!regBlank.test(document.registeruser.mname.value)){document.getElementById("mname").style.backgroundColor="#FF9393";return false;}	
if(!regBlank.test(document.registeruser.email.value)){document.getElementById("email").style.backgroundColor="#FF9393";return false;}
if(the_mail(document.registeruser.email.value)){document.getElementById("email").style.backgroundColor="#FF9393";return false;}
if(!regBlank.test(document.registeruser.lname.value)){document.getElementById("lname").style.backgroundColor="#FF9393";return false;}
if(!regBlank.test(document.registeruser.address.value)){document.getElementById("address").style.backgroundColor="#FF9393";return false;}	
if(!regBlank.test(document.registeruser.city.value)){document.getElementById("city").style.backgroundColor="#FF9393";return false;}	
if(!regBlank.test(document.registeruser.state.value)){document.getElementById("state").style.backgroundColor="#FF9393";return false;}	
if(!regBlank.test(document.registeruser.country.value)){document.getElementById("country").style.backgroundColor="#FF9393";return false;}	
	
}

function regis_pro(){
	var regBlank = /[^\s]/;
	var regBlank1=/[^\s]/;
var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";

if(!regBlank.test(document.registerproduct.styleno.value)){document.getElementById("styleno").style.backgroundColor="#FF9393";return false;}	
if(!regBlank.test(document.registerproduct.country.value)){document.getElementById("country").style.backgroundColor="#FF9393";return false;}	
if(!regBlank.test(document.registerproduct.purchasedate.value)){document.getElementById("purchasedate").style.backgroundColor="#FF9393";return false;}	
if(!regBlank.test(document.registerproduct.zip.value)){document.getElementById("zip").style.backgroundColor="#FF9393";return false;}
if(!regBlank.test(document.registerproduct.retailer.value)){document.getElementById("retailer").style.backgroundColor="#FF9393";return false;}
if(the_mail(document.registerproduct.email.value)){document.getElementById("email").style.backgroundColor="#FF9393";return false;}
if(!regBlank.test(document.registerproduct.firstname.value)){document.getElementById("firstname").style.backgroundColor="#FF9393";return false;}
if(!regBlank.test(document.registerproduct.lastname.value)){document.getElementById("lastname").style.backgroundColor="#FF9393";return false;}	
if(!regBlank.test(document.registerproduct.address.value)){document.getElementById("address").style.backgroundColor="#FF9393";return false;}
if(!regBlank.test(document.registerproduct.city.value)){document.getElementById("city").style.backgroundColor="#FF9393";return false;}
if(!regBlank.test(document.registerproduct.state.value)){document.getElementById("state").style.backgroundColor="#FF9393";return false;}
}

function check_cotactus(){
	var regBlank = /[^\s]/;
	var regBlank1=/[^\s]/;
var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";

if(the_mail(document.contactuser.email.value)){document.getElementById("email").style.backgroundColor="#FF9393"; document.contactuser.email.focus(); return false;}
if(!regBlank.test(document.contactuser.subject.value)){document.getElementById("subject").style.backgroundColor="#FF9393";document.contactuser.subject.focus();return false;}
if(!regBlank.test(document.contactuser.message.value)){document.getElementById("message").style.backgroundColor="#FF9393";document.contactuser.message.focus();return false;}
}
<!--checking field end-->




function createRequestObject() {
   var req;
   if(window.XMLHttpRequest){
      req = new XMLHttpRequest();
   } else if(window.ActiveXObject) {
      req = new ActiveXObject("Microsoft.XMLHTTP");
   } else {
      alert('Problem creating the XMLHttpRequest object');
   }
   return req;
}
var http = createRequestObject();

function selectcountryajax(id) {
document.getElementById("selectstateajax").innerHTML = "Loading...";
http.open('get','selectcountryajax.php?act=state&&pid='+id+'');
http.onreadystatechange = handleResponse;
http.send(null);
}

function handleResponse() {
   if(http.readyState == 4 && http.status == 200){
      var response = http.responseText;
      if(response!="")
	  {
	 	  document.getElementById("selectstateajax").innerHTML = '';
         document.getElementById("selectstateajax").innerHTML = response;
      }
   }
}

function selectstateajax(id) {
document.getElementById("selectcityajax").innerHTML = "Loading...";
http.open('get','selectcountryajax.php?act=city&&pid='+id+'');
http.onreadystatechange = handleResponsecity;
http.send(null);
}

function handleResponsecity() {
   if(http.readyState == 4 && http.status == 200){
      var response = http.responseText;
      if(response!="")
	  {
	 	  document.getElementById("selectcityajax").innerHTML = '';
         document.getElementById("selectcityajax").innerHTML = response;
      }
   }
}

