function show_signup()
{
	/*document.getElementById('emailaddress').value = "";
	document.getElementById('confirm-emailaddress').value = "";
	document.getElementById('rpassword').value = "";
	document.getElementById('confirm-rpassword').value = "";
	document.getElementById('username').value = "";
	document.getElementById('password').value = "";*/
	//document.getElementById('signupframe').src = document.getElementById('signupframe').src;
	var temp = document.getElementById('signupdiv').innerHTML;
	document.getElementById('signupdiv').innerHTML = temp;
	document.getElementById('curr_div').value = "signupdiv";
	document.getElementById('signupdiv').style.display = "block";
	document.getElementById('fade').style.display = "block";
	centering_popup('signupdiv','fade');
}

function show_exception_popup()
{
	document.getElementById('curr_div').value = "exceptional_state_div";
	document.getElementById('exceptional_state_div').style.display = "block";
	document.getElementById('fade').style.display = "block";
	centering_popup('exceptional_state_div','fade');
}

function closelight()
{
  document.getElementById(document.getElementById('curr_div').value).style.display='none';
  document.getElementById('fade').style.display='none';
}

function validate_sign_in()
{
	if(GenValidation(document.getElementById('username'),'User Name','','','') == '')
	{
		return false;
	}
	if(GenValidation(document.getElementById('password'),'Password','','','') == '')
	{
		return false;
	}
}

function validate_signup_popup()
{
	if(GenValidation(document.getElementById('emailaddress'),'Email address','','','') == '')
	{
		return false;
	}
	if(!EmailValidation(document.getElementById('emailaddress')))
	{
		return false;
	}
	if(GenValidation(document.getElementById('confirm-emailaddress'),'Confirm email address','','','') == '')
	{
		return false;
	}
	if(!ConfirmEmailValidation(document.getElementById('emailaddress'),document.getElementById('confirm-emailaddress')))
	{
		return false;
	}
	if(GenValidation(document.getElementById('rpassword'),'Password','Password',6,'') == '')
	{
		return false;
	}
	if(!PasswordValidation(document.getElementById('rpassword')))
	{
		return false;
	}
	if(GenValidation(document.getElementById('confirm-rpassword'),'Confirmation Password','','','') == '')
	{
		return false;
	}
	if(!PassValidation(document.getElementById('rpassword'),document.getElementById('confirm-rpassword')))
	{
		return false;
	}
	
//Follwing function is defined inside <head></head> tag of  header.php 
	check_email();
	return false;
}

var ajax= new sack();

function  parseajax()
{
   //alert(ajax.response);
   eval(ajax.response);
}



///////////////////////////MENU /////////////////////////////
// JavaScript Document
	        $(document).ready(function() {
 // hides the slickbox as soon as the DOM is ready
 
 // toggles the slickbox on clicking the noted link
  $('#contact-us').mouseover(function() {
											   $('#menubox-b').hide();
 $('#menubox-oc').hide();
 return false;
  });
  
    $('#aboutus').mouseover(function() {
											   $('#menubox-b').hide();
 $('#menubox-oc').hide();
 return false;
  });
  
  
  
  
  
 
  $('#menubox-oc').hide();


 // toggles the slickbox on clicking the noted link
  $('#top-our-collection').mouseover(function() {
											   $('#menubox-b').hide();
 $('#menubox-oc').show();
 return false;
  });
  
  
  
   // toggles the slickbox on clicking the noted link
  $('.togg').mouseover(function() {
 $('#menubox-oc').hide();
 return false;
  });
  
 
   // toggles the slickbox on clicking the noted link
  $('#header-main').mouseleave(function() {
 $('#menubox-oc').hide();
 return false;
  });
  
  
  $('#header-main').mousemove(function(e){

	  
	var x = e.pageX - this.offsetLeft;
	var y = e.pageY - this.offsetTop;
	
      //$('#menubox-oc').html(x +', '+ y);	
	  
	  if ((x < 255 && y < 98) || (x > 350 && y < 98) || (y<40) )
	  {
		  $('#menubox-oc').hide();
	  }
	  
	  //alert( )
	  /*
	  if ((x >= 257 && x <= 349 ) )
	  {
		  if (document.getElementById('menubox-b').style.display == "none")	
		  {
		 	$('#menubox-oc').show();	  	
		  }
	  }
	  else if (y < 98 )
	  {


	 $('#menubox-oc').hide();	  		  	
	  }	
	  */
	  
	  	 // alert(y);




   }); 
  
  
      $('#menubox-b').hide();
 // toggles the slickbox on clicking the noted link
  $('#top-brands').mouseover(function() {
									  $('#menubox-oc').hide(); 
 $('#menubox-b').show();
 return false;
  });
  
     // toggles the slickbox on clicking the noted link
  $('.togg').mouseover(function() {
 $('#menubox-b').hide();
 return false;
  });
  
     // toggles the slickbox on clicking the noted link
  $('#header-main').mouseleave(function() {
 $('#menubox-b').hide();
 return false;
  });
  

    $('#header-main').mousemove(function(e){

	  
	var x = e.pageX - this.offsetLeft;
	var y = e.pageY - this.offsetTop;

	
      //$('#menubox-b').html(x +', '+ y);	
	  
	  if ((x < 368 && y < 98) || (x > 417 && y < 98) || (y<40) )
	  {
		  $('#menubox-b').hide();
	  }
	  
	  //alert( )
	  /*
	  if ((x >= 457 && x <= 749 ) )
	  {
		 $('#menubox-b').show();	  	
	  }
	  else if (y < 98 )
	  {


	 $('#menubox-b').hide();	  		  	
	  }	
	  */

   }); 

  	  
  
  
 /*
 // toggles the slickbox on clicking the noted link
  $('#slick-toggle').click(function() {
 $('#slickbox').slideToggle(700);
 return false;
  });
  
  
  $('.togg').click(function(){$('#selected_sort_by').text($(this).text()); }); 
  */
  
});
			
			
			
//PRELOAD SOME IMAGES - STARTS
function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}
//PRELOAD SOME IMAGES - ENDS
