


	function alphanumeric(alphane)
	{
		var numaric = alphane;
		for(var j=0; j<numaric.length; j++)
			{
			  var alphaa = numaric.charAt(j);
			  var hh = alphaa.charCodeAt(0);
			  if((hh > 47 && hh<59) || (hh > 64 && hh<91) || (hh > 96 && hh<123))
			  {
			  }
			else	{
				 return false;
			  }
			}
	 return true;
	}

	function rotateImage(imageUrl,fullimageUrl) 
	{
		document.getElementById('mainProductImage').innerHTML='<a href="'+fullimageUrl+'" target="_blank"><img src="main_binary.asp?path=' + imageUrl + '&width=430&height=430&Interpolation=1"  border="0"></a>';
		document.getElementById('zoomLink').innerHTML='<a href="'+fullimageUrl+'" target="_blank"><img src="images/zoom.jpg" width="50" height="16" border="0"></a>';
	}
					

	function openNewWindow(vpagename, vwidth, vheight)
	{
		var posx = (screen.availWidth  - 300)/2;
		var posy = (screen.availHeight - 150)/2;
		var filename = 'http://www.fashioncircus.net/'+vpagename;
	
		var wintitle = 'FashionCircus_New_Window';
		var property = 'toolbar=no,status=no,width='+vwidth+',height='+vheight+',directories=no,scrollbars=yes,top=' + posy + ',left=' + posx + ',location=no,resizable=no,menubar=no';
		chkwnd = window.open(filename, wintitle, property);

	chkwnd.focus();
	}




	function CheckEmail(input) 
	{
		var LenInput = input.length;
		var posat = -1;
		var posdot = -1;
		var chAddr = "";
		var indexdot = 0;

		for(var i = 0; i < LenInput; i++)
		{
			chAddr = input.charAt(i);

			if(chAddr == '@')
			{
				if(i == 0 || i == LenInput-1)
					return false;
				posat = i;
			}
			else if(chAddr == '.')
			{
				
				if(i == 0 || i == LenInput-1)
					return false;
				else 
				{
					if(i == posdot + 1 || i == LenInput-1)
						return false;
					posdot = i;
					indexdot = indexdot + 1
					
					if(indexdot > 3)
						return false;
				}
			}
		}         
		
		if (input == "" || posat == -1 || posat == LenInput-1 || posdot == -1 || posdot == LenInput-1)
		   	return false;
		else
			return true;
		
	}
	
	
	function addDestination()
{	var destination_1=document.getElementById('shipping_profile_1');
	//get container box
	var destination_container=document.getElementById('shipping_profile_container');
	
	var newDestination=document.createElement('div');
	newDestination.innerHTML=destination_1.innerHTML;
	destination_container.appendChild(newDestination);  
	
	
	//remove and re-append the addbox div to keep it at the end
	var add_box=document.getElementById('more_shipping_box');
	destination_container.removeChild(add_box);
	destination_container.appendChild(add_box);
}
function trim(text)
{
    return text.replace(/^\s*|\s*$/g,'');
}


function disableEnterKey(e)
{
     var key;

     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

     if(key == 13)
     {	addTag(document.getElementById('newTag').value);
      	return false;
     }
     	 
     else
     {	return true;
     }
          
}
