 
  var query = window.location.href;

  if ((query=='http://velissilver.com/') || (query=='http://velissilver.com/index.html') || (query=='http://velissilver.com/index.php') || (query=='http://velissilver.com/index.php')) 

  { 

    window.location="http://www.velissilver.com";

  } 



  if ((query=='https://velissilver.com/') || (query=='https://velissilver.com/index.html') || (query=='https://velissilver.com/index.php') || (query=='https://www.velissilver.com/index.php'))

  {

    window.location="https://www.velissilver.com";

  }
 
  
    
  
  function displ(ddd) { if (document.getElementById(ddd).style.display == 'none') {document.getElementById(ddd).style.display = 'block'} else {document.getElementById(ddd).style.display = 'none'} }  
function get_subcat(cid, plcid){
	
	var pars = '';
    var url = 'getsubcat.php?cid='+cid;
	var myAjax = new Ajax.Updater(plcid, url, { method: 'get', parameters: pars});
}



function change(){

document.news.email.value 	= "";
}



function validate()
{
  var keyw	=	document.frm2.keyword.value;
  if(keyw == '')
  {
    alert("Keyword cannot be left blank.");
	document.frm2.keyword.focus();
	return false;
  }
}



function show(id)
{
	 
  var tot	=	document.getElementById('totcats').value;
 for(var i =1;i<=tot;i++){
  document.getElementById(i).className = 'hide';
  document.getElementById('a'+i).className = '';
 } 
  
/*  if(document.getElementById(id).className == 'show')
  {
  document.getElementById('a'+id).className = '';
  document.getElementById(id).className = 'hide';
  }
  else{	*/
  document.getElementById('a'+id).className = 'active';
  document.getElementById(id).className = 'show';
  //}
	 
} 


function show2(id)
{
	 
  var tot2	=	document.getElementById('totptypes').value;
 
 for(var i =1;i<=tot2;i++){
  document.getElementById('qq'+i).className = 'hide';
  document.getElementById('q'+i).className = '';
 } 
  
 
  document.getElementById('q'+id).className = 'active';
  document.getElementById('qq'+id).className = 'show';
  
	 
}


function bookmark(){
var title = 'Velissilver :: Jewlry At Its Best! ::';
var url = 'http://www.velissilver.com/';
   if (document.all)
     window.external.AddFavorite(url, title);
   else if (window.sidebar)
     window.sidebar.addPanel(title, url, "")
   else if (window.sidebar&&window.sidebar.addPanel)
     window.sidebar.addPanel(title,url,"");
}


function clearr(){
//alert("here");
	document.contact.lname.value 	= "";
	document.contact.country.value 	= "";
	document.contact.email.value 	= "";
	document.contact.subject.value 	= "";
	document.contact.message.value 	= "";
	document.contact.cfor.value 	= "";

	

}


function doclear(id){
 
	if(document.getElementById(id).value 	== "* First Name" || document.getElementById(id).value 	== "* Last Name" || document.getElementById(id).value 	== "* Email" || document.getElementById(id).value 	== "* Phone")

			document.getElementById(id).value 	=  "";
 
}


 
function get_subcat(cid, plcid){
	
	var pars = '';
    var url = 'getsubcatmap.php?cid='+cid;
	var myAjax = new Ajax.Updater(plcid, url, { method: 'get', parameters: pars});
}

function open_wind(pid,imgid)
{
	//alert(imgid)
	window.open("limg.php?pid="+pid+"&page="+imgid ,"Mywin","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=650, height=630");
}

function clearSearchBox(searchBox, defaultValue)
{
	if (searchBox.value == defaultValue)
	{
		searchBox.value = '';
	}
}
function get_image(pid, id, plcid){
	
	var pars = '';
    var url = 'get_image.php?pid='+pid+'&id='+id;
	var myAjax = new Ajax.Updater(plcid, url, { method: 'get', parameters: pars});
}

function get_image2(pid, id, secid, plcid){
	
	var pars = '';
    var url = 'get_image.php?pid='+pid+'&id='+id+'&secid='+secid;
	var myAjax = new Ajax.Updater(plcid, url, { method: 'get', parameters: pars});
}


function lengthselect()
{
	if(document.getElementById('leng')){
	var len = document.getElementById('leng').value;
	if (len == '')
	{
		alert('Please select size prior to adding this item to your cart');
return;
	}
	else {
   document.getElementById('frm').submit()
 
	}
	}
	else{
   document.getElementById('frm').submit()
	}
}
function openPopUp(url)
{
 var width = 186+10;
 var height = 264+10;
 var left = (screen.availWidth-width)/2;
 var top = (screen.availHeight-height)/2;
 
 // scrollbars,
 var w = window.open(url,'popup_window','width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',resizable=no,toolbar=0');
 w.focus();
}


function open_wind2(imgid)
{
	//alert(imgid)
	window.open(imgid ,"Mywin","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=650, height=630");
}

function changeit(){
	
	 document.getElementById('us1').checked  = false;
	 document.getElementById('us2').checked = true;
}


function validate1()
{
	
				var t = chkfree();
	     var gtot = document.getElementById('gtotal').value;
	 
		if( t == 2)
		{
	 
	    var ptype = document.getElementById('ptyp').value;
	
		 
		if(gtot < 10)
		{
			alert("Attention: the Grand Total of your order should amount a minimum of USD 10!");
			return false;
		}
		else if(ptype)
		{
			
			document.cartfrm.action='checkout.php';
			document.cartfrm.submit();
			return true;
		}
		else
		{
			alert("Please select the payment method!");
			return false;
		}
		
		}
		else{
	 		return false;
		    
		}
}

function chkfree(){
		if(document.getElementById('freeis')){
		if(document.getElementById('freeis').value == 1){
			alert("Please Select Your Free gift.")
		return 1;
		}}
		else{
			return 2;
		}
	} 
		
	function go_to_chk1()
	{
	  document.cartfrm.action='checkout_1.php';
	  document.cartfrm.submit();
	}
	
		function updqty()
	{
	  document.cartfrm.action='updatebasket.php';
	  document.cartfrm.submit();
	}
	
	
	
function updatecountry(cid, plcid){

	

	var pars = '';

    var url = 'getshipp.php?cid='+cid;

	var myAjax = new Ajax.Updater(plcid, url, { method: 'get', parameters: pars});

}
