function changeColor(cBox)
{
	mailObj = document.getElementById(cBox.id + '_mail');
	if(cBox.checked)
	{
		mailObj.style.color = "#bbb";
	}
	else
	{
		mailObj.style.color = "black";
	}
}

function changeCat(href)
{
	window.location = href;
}


function getGroups(element)
{
	lightBox = new flexibleBox(element,
	{
		x:0,
		y:0,
		width:550,
		height:400,
		opacity:1
	});
	lightBox.popUp(element);
}


function openTab(parentId)
{
	if($("group_" + parentId+'_2'))
	{
		menuList = document.getElementsByTagName("ul");
		selfObj = document.getElementById("group_" + parentId);
		if($("group_" + parentId+'_2')) selfObj2 = document.getElementById("group_" + parentId+'_2');		
		selfObj.innerHTML = "<span style='padding: 0 0px 0 0px;border:0;height:22px;width:24px;'><img src='../image/arrow_retailer2.gif' /></span>";
		selfObj.href = "javascript:closeTab(" + parentId + ")";
		if($("group_" + parentId+'_2')) selfObj2.href = "javascript:closeTab(" + parentId + ")";	
		for(var i = 0; i < menuList.length; i++)
		{
			if(menuList[i].getAttribute("atr") == "cat")
			{
				if(menuList[i].getAttribute("parentId") == parentId)
				{
					menuList[i].className = "selected";
				}
			}
		}
	}
	else
	{
		menuList = document.getElementsByTagName("ul");
		selfObj = document.getElementById("group_" + parentId);
		selfObj.innerHTML = "<span style='padding: 0 1px 0 2px;'>-</span>";
		selfObj.href = "javascript:closeTab(" + parentId + ")";
		for(var i = 0; i < menuList.length; i++)
		{
			if(menuList[i].getAttribute("atr") == "cat")
			{
				if(menuList[i].getAttribute("parentId") == parentId)
				{
					menuList[i].className = "selected";
				}
			}
		}	
	}
}

function closeTab(parentId)
{
	if($("group_" + parentId+'_2'))
	{
		menuList = document.getElementsByTagName("ul");
		selfObj = document.getElementById("group_" + parentId);
		if($("group_" + parentId+'_2')) selfObj2 = document.getElementById("group_" + parentId+'_2');	
		selfObj.innerHTML = "<img src='../image/arrow_retailer1.gif' />";
		selfObj.href = "javascript:closeAllTab();openTab(" + parentId + ")";
		if($("group_" + parentId+'_2')) selfObj2.href = "javascript:closeAllTab();openTab(" + parentId + ")";	
		for(var i = 0; i < menuList.length; i++)
		{
			if(menuList[i].getAttribute("atr") == "cat")
			{
				if(menuList[i].getAttribute("parentId") == parentId)
				{
					menuList[i].className = "";
				}
			}
		}
	}
	else
	{
		menuList = document.getElementsByTagName("ul");
		selfObj = document.getElementById("group_" + parentId);
		selfObj.innerHTML = "+";
		selfObj.href = "javascript:openTab(" + parentId + ")";
		for(var i = 0; i < menuList.length; i++)
		{
			if(menuList[i].getAttribute("atr") == "cat")
			{
				if(menuList[i].getAttribute("parentId") == parentId)
				{
					menuList[i].className = "";
				}
			}
		}	
	}
}

function openRow()
{
	rows = document.getElementsByTagName("tr");
	for(var i = 0; i < rows.length; i++)
	{
		if(rows[i].getAttribute("att") == "priceRow")
		{
			rows[i].style.display="";
		}
	}
}

function news_change_display(objId, flag)
{
if(flag == true)
	document.getElementById(objId).style.display ="";
else
	document.getElementById(objId).style.display ="none";
}
function news_change_out()
{ 
     var arguments = news_change_display.arguments;
     document.getElementById(arguments[0]).style.display ="none";
     alert("88");
     
}

function popUp(a_link) {
   props=window.open(a_link, 'New Page', 'toolbars=0, scrollbars=1, location=0, statusbars=1, menubars=0, resizable=1, width=800, height=400, left = 100, top = 100');
}

function popUp_News(a_link,newsid) {
   if( navigator.userAgent.indexOf('Firefox')  || navigator.userAgent.indexOf('Safari') ) {
   window.open(a_link + '?id=' + newsid, 'LELO NEWS', 'toolbars=0, scrollbars=1, location=0, statusbars=1, menubars=0, resizable=0, width=400, height=500, left = 100, top = 100');
   } 
   else if( navigator.userAgent.indexOf('MSIE') ) {
     window.location =a_link + '?id=' + newsid;
   }
	else {
	 window.location=a_link  + '?id=' + newsid;
	}	    
}

function popUpForWin(a_link) {
   window.location=a_link;
}

function confirm_input_ps(str,str2)  {
 // document.getElementById('Password_2').style.border='1px solid #AAAAAA';
 // document.getElementById('Password').style.border='1px solid #AAAAAA';
   if(document.getElementById('Password').value != document.getElementById('Password_2').value) {
      alert(str);
	//  document.getElementById('Password_2').style.border='1px solid #FF0000';
   }else if(document.getElementById('Password').value.length<5) {
	//  document.getElementById('Password').style.border='1px solid #FF0000';
      alert(str2);
   }
}


function isEmail(){
        var strEmail =  document.getElementById('email').value;
        //var strcheck=/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/;
        var strcheck=/^[a-zA-Z0-9]([a-zA-Z0-9]*[-_.]?[a-zA-Z0-9]+)+@([\w-]+\.)+[a-zA-Z]{2,}$/;
		//var strcheck=/(\S)+[@]{1}(\S)+[.]{1}(\w)+/;
		if( strcheck.test(strEmail) )
 			return true;
 		else {
 		    alert("The email format is not correct!");
 		    //document.getElementById('email').focus();
 		    return false; }	
}

function isEmail2(){
        var strEmail =  document.getElementById('Log_in').value;
        //var strcheck=/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/;
        var strcheck=/^[a-zA-Z0-9]([a-zA-Z0-9]*[-_.]?[a-zA-Z0-9]+)+@([\w-]+\.)+[a-zA-Z]{2,}$/;
		//var strcheck=/(\S)+[@]{1}(\S)+[.]{1}(\w)+/;
		if( strcheck.test(strEmail) )
 			return true;
 		else {
 		    alert("The email format is not correct!");
 		    //document.getElementById('email').focus();
 		    return false; }	
}

function isEmail3(){
        var strEmail =  document.getElementById('email').value;
        //var strcheck=/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/;
        var strcheck=/^[a-zA-Z0-9]([a-zA-Z0-9]*[-_.]?[a-zA-Z0-9]+)+@([\w-]+\.)+[a-zA-Z]{2,}$/;
		//var strcheck=/(\S)+[@]{1}(\S)+[.]{1}(\w)+/;
		if( strcheck.test(strEmail) )
 			return true;
 		else {
 		    alert("The email format is not correct!");
 		    //document.getElementById('email').focus();
 		    return false; }	
}

function change_enable(value) {
    document.getElementById('Cust_Shipp_Contact').disabled=value;
    document.getElementById('Cust_Shipp_Address').disabled=value;
    document.getElementById('Cust_Shipp_Address_2').disabled=value;    
    document.getElementById('Cust_Shipp_Postcode').disabled=value;
    document.getElementById('Cust_Shipp_Town').disabled=value;
    document.getElementById('Cust_Shipp_State').disabled=value;
    document.getElementById('Cust_Shipp_Country').disabled=value;
    document.getElementById('Cust_Shipp_Telephone').disabled=value;
    document.getElementById('Cust_Shipp_Email').disabled=value;
    var elm = document.getElementById("display_control1");
 
   if(document.getElementById('Shipp_Add_Same').checked==true)  
     {  
         for(i=1;i<20;i++) {
				elm = document.getElementById("display_control"+i);
			    elm.style.display = "none";
  			  }
     }
	else{
		for(i=1;i<20;i++) {
				elm = document.getElementById("display_control"+i);
			    elm.style.display = "inline";
  			  }
	}

	//alert(document.getElementById('display_control1').style.display);
	

}

function change_enable2(value) {
    document.getElementById('ship_company').disabled=value;	
    document.getElementById('ship_firstName').disabled=value;
	document.getElementById('ship_lastName').disabled=value;
    document.getElementById('ship_street').disabled=value;
    document.getElementById('ship_street2').disabled=value;    
    document.getElementById('ship_town').disabled=value;
    document.getElementById('ship_state').disabled=value;
    document.getElementById('ship_postcode').disabled=value;
    document.getElementById('ship_countryCode').disabled=value;
    document.getElementById('ship_phoneNumber').disabled=value;
	
    //var elm = document.getElementById("display_control1");
 
   if(document.getElementById('Shipp_Add_Same').checked==true)  
     {  
	    document.getElementById('ship_company').value=document.getElementById('company').value;	
	    document.getElementById('ship_firstName').value=document.getElementById('firstName').value;
		document.getElementById('ship_lastName').value=document.getElementById('lastName').value;
	    document.getElementById('ship_street').value=document.getElementById('street').value;
	    document.getElementById('ship_street2').value=document.getElementById('street2').value;    
	    document.getElementById('ship_town').value=document.getElementById('town').value;
	    document.getElementById('ship_state').value= document.getElementById('state').value;
	    document.getElementById('ship_postcode').value=document.getElementById('postcode').value;
		$( 'ship_countryCode' ).value = $( 'countryCode' ).value;
		document.getElementById('ship_phoneNumber').value=document.getElementById('phoneNumber').value;
		for(i=1;i<=22;i++) {
				elm = document.getElementById("display_control"+i);
			    elm.style.display = "none";
  			  }
     }
	else{
		for(i=1;i<=22;i++) {
				elm = document.getElementById("display_control"+i);
			    elm.style.display = "inline";
  			  }
	}

	//alert(document.getElementById('display_control1').style.display);
	

}

function  popLinks()
{
  
 // alert("func called");
 /*
  var arguments = popLinks.arguments;
  
  var attachment='';
    for (var i = 1; i < arguments.length; i++)
          {
               //alert("Argument number " + i + " value = " + arguments[i]);
               
               //alert("attachment_" + i);
               
               //var kk = document.getElementById("attachment_" + i).innerHTML = "<a href=\""+arguments[i]+"\" >" + 1 + "</a>";
               var kk = document.getElementById("attachment_" + i);
               kk.style
               alert(kk); 
           } 
    
 
 
  //popArray[0]="news"  
  //popArray[1]="filename.jpg"  
  
alert(arguments[0]);
var aa = document.getElementById(arguments[0]);
 alert(aa);
 if( arguments[1]!='')   
   {
      var   popStr2   =   arguments[1];  
      popArray2   =   popStr2.split("/");
      var   short2= popArray2[1];
      shortarray2 = short2.split("_");
      document.getElementById('attachment_1').innerHTML = "<a href=\"../upload/"+arguments[1]+"\" >-" + shortarray2[shortarray2.length-1] + " -</a>";
   }
 if( arguments[2]!='')
   {
      var   popStr3   =   arguments[2];  
      popArray3   =   popStr3.split("/");
      var   short3= popArray3[1];
      shortarray3 = short3.split("_");           
      document.getElementById('attachment_2').innerHTML = "<a href=\"../upload/"+arguments[2]+"\" >-" + shortarray3[shortarray3.length-1] + " -</a>";           
   }
   
  if( arguments[3]!='')
   { 
      var   popStr4   =   arguments[3];  
      popArray4   =   popStr4.split("/");
      var   short4= popArray4[1];
      shortarray4 = short4.split("_");
      document.getElementById('attachment_3').innerHTML = "<a href=\"../upload/"+arguments[3]+"\" >-" + shortarray4[shortarray4.length-1] + " -</a>";  
   }
   /*
    if( arguments[0]!='')
   { 
      popDiv = document.getElementById(arguments[0]).style.display ="";
      
  		alert(popDiv.id);
   }
   else
   {
   	alert("fefe");
   }
   
   document.getElementById(arguments[0]).style.display ="";
   */
 
}

function popWindow(href, windowname)
{
	if (!window.focus)
		return true;
	window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
	return false;
}

function popBigWindow(href, windowname)
{
	if (!window.focus)
		return true;
	window.open(href, windowname, 'width=650,height=500,scrollbars=yes');
	return false;
}


function targetOpener(imgType, selectedImg)
{
	if(!(window.focus && window.opener))
		return true;
	window.opener.focus();
	
	window.opener.document.getElementById(imgType).value=selectedImg;
	
	window.close();
	return false;
}

function  del_info(id)
	     {
		    var url_del="";
			url_del += "forum.php?page=Cancel&threadid=" + id;
            if (confirm("Cancel this Thread?")) window.open(url_del,"_self");
	     } 
	     
	     
function sliding(obj)
{
	
	
}

function crop_deprecated()
{
	if(typeof(window.innerHeight) == 'number')
	{
		//alert("windowInnerHeight" + window.innerHeight);
		if(window.innerHeight > 600)
		{
			document.getElementById('pageContainer').style.marginTop = (window.innerHeight-602)*0.5+"px";
			document.getElementById('pageContainer').style.marginBottom = (window.innerHeight-602)*0.5+"px";
			//document.body.backgroundPosition = "10px 48px";
		}
		else
		{
			document.getElementById('pageContainer').style.marginTop = 0;
			document.getElementById('pageContainer').style.marginBottom = 0;
			//document.body.style.backgroundPosition.Top = "1034px";
		}
	}
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
	{
		//alert("documentDocumentElement : " + document.documentElement.clientHeight);
		if(document.documentElement.clientHeight > 600)
		{
			document.getElementById('pageContainer').style.marginTop = (document.documentElement.clientHeight-602)*0.5+"px";
			document.getElementById('pageContainer').style.marginBottom = (document.documentElement.clientHeight-602)*0.5+"px";
		}
		else
		{
			document.getElementById('pageContainer').style.marginTop = 0;
			document.getElementById('pageContainer').style.marginBottom = 0;
		}
	}
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight) )
	{
		//alert("documentBodyClientHeightb : " + document.body.clientHeight);
		if(document.body.clientHeight > 600)
		{
			document.getElementById('pageContainer').style.marginTop = (document.body.clientHeight-602)*0.5+"px";
			document.getElementById('pageContainer').style.marginBottom = (document.body.clientHeight-602)*0.5+"px";
		}
		else
		{
			document.getElementById('pageContainer').style.marginTop = 0;
			document.getElementById('pageContainer').style.marginBottom = 0;
		}
	}
	document.body.style.opacity = 1;
}

function setClass(obj)
{
	var tagArray = document.getElementById("showerTagGroup").childNodes;
	
	//alert(tagArray);
	for(var i = 0; i < tagArray.length; i++)
	{
		if(tagArray[i].tagName == "A");
			tagArray[i].className = "tag";
	}
	obj.className = "selected";
}


/*
function window.onbeforeunload()
{
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){
window.event.returnValue="";} 
*/
/*
function  body_unLoad()  { 
// if  (event.clientX>document.body.clientWidth  &&  event.clientY<0 ||event.altKey) 
     window.event.returnValue="";  
 }
 */
function body_unLoad() {
	//confirm('exit?');
	//alert('exit');
	if( (event.clientX>document.body.clientWidth && event.clientY<0 ) || event.altKey ) {
			window.event.returnValue="Exit?";
	}
}


//generate the cupon randomly


function getCupon()
{
	
	new Request.HTML(
	{
		url:'/admin/cuponGenerator.php',
		//method:'get',
		//update:$('cupongenerator'),
		onSuccess:function(HTML)
		{
			$('cupongenerator').empty();
			$('cupongenerator').adopt(HTML);
			//alert(document.getElementById("cupongenerator").innerHTML);
			document.getElementById("tempCupon").value=document.getElementById("cupongenerator").innerHTML;
			
		},
		onFailure: function() 
		{
			$('result').set('text', 'The request failed.');
		}
	}
	).get();
}

// //process the cupon in the paymentForm.php
// function processDiscount()
// {

	// var cupon = document.getElementById('cupon').value;
	// //var url = "AjaxProcessor.php?discount=1&cupon="+cupon;
	// var discount = $('discount');
	// discount.empty().addClass('ajax-loading');
	// new Request.HTML(
	// {
		// url:'AjaxProcessor.php',
		// onSuccess:function(HTML)
		// {
			// discount.removeClass('ajax-loading');
			// discount.empty();
			// discount.adopt(HTML);
		// },
		// onFailure: function() 
		// {
			// $('result').set('text', 'The request failed.');
		// }
	// }
	// ).get({'discount':1,'cupon':cupon});

	
	// //var url = "AjaxProcessor.php?total=&cupon="+cupon;
	// var total = $('total');
	// total.empty().addClass('ajax-loading');
	// new Request.HTML(
	// {
		// url:'AjaxProcessor.php',

		// onSuccess:function(HTML)
		// {
			// total.removeClass('ajax-loading');
			// total.empty();
			// total.adopt(HTML);
		// },
		// onFailure: function() 
		// {
			// $('result').set('text', 'The request failed.');
		// }
	// }
	// ).get({'total':1,'cupon':cupon});
	
	// var url = "AjaxProcessor.php?vat=&cupon="+cupon;
	// var vat = $('vat');
	// vat.empty().addClass('ajax-loading');
	// new Request.HTML(
	// {
		// url:'AjaxProcessor.php',
		// onSuccess:function(HTML)
		// {
			// vat.removeClass('ajax-loading');
			// vat.empty();
			// vat.adopt(HTML);
		// },
		// onFailure: function() 
		// {
			// $('result').set('text', 'The request failed.');
		// }
	// }
	// ).get({'vat':1,'cupon':cupon});
	
// }

function validateDiscount(id)
{
	var temp = document.getElementById(id).value;
	var re = /\d+\d*/;
	if(re.exec(temp))
	{
		if(parseInt(document.getElementById(id).value)>100||parseInt(document.getElementById(id).value)<0)
		{
			alert("Out of the range");
		}
	}
	else
	{ 
		alert("please type in the digits");
	}
}

function checkBoxInCart () {
    if (document.getElementById('couponInput').checked) {
		document.getElementById('inputCoupon').style.display = "inline";
		document.getElementById('couponKey').style.display = 'inline';
    }	else	{
		document.getElementById('inputCoupon').style.display = "none";
		document.getElementById('couponKey').style.display = "none";
	}	
}

function check_1() 
{
	if(!document.getElementById('address_checkBox').checked)
	{
		document.getElementById('phone_1').style.display = "none";
		document.getElementById('phone_2').style.display = "none";
		document.getElementById('phone_3').style.display = "none";
		document.getElementById('phone_4').style.display = "none";
		if($chk($('cust_email_1')))
		{
			document.getElementById('cust_email_1').style.display = "none";
			document.getElementById('cust_email_2').style.display = "none";
			document.getElementById('cust_email_3').style.display = "none";
		}
	}
	else
	{
		document.getElementById('phone_1').style.display = "block";
		document.getElementById('phone_2').style.display = "block";
		document.getElementById('phone_3').style.display = "block";
		document.getElementById('phone_4').style.display = "block";
		if($chk($('cust_email_1')))
		{
			document.getElementById('cust_email_1').style.display = "block";
			document.getElementById('cust_email_2').style.display = "block";
			document.getElementById('cust_email_3').style.display = "block";
		}
	}
}

function check_2()
{
	if(document.getElementById('up_checkBox').checked)
	{
		document.getElementById('oldAddBox').style.display = "block";
		document.getElementById('newAddBox').style.display = "none";
	}
	else
	{
		document.getElementById('oldAddBox').style.display = "none";
		document.getElementById('newAddBox').style.display = "block";
	}
}

function fadeOut(element)
{
	
	var fadeout = new Fx.Tween(element, {
	property: 'opacity',
	duration: 1500, 
	transition: Fx.Transitions.Quart.easeInOut
	});
	fadeout.start(1,0.88); 
}

function fadeIn(element)
{
	$(element).setStyle('opacity',1);
}

function checkNeedsValue() {
	
	if( !$( 'Cust_Name' ).value  ) { alert( 'Retailer Name required' );  return false; }
	if( !$( 'Log_in').value ) { alert('User Name required!'); return false; }
	if( !$( 'Password').value ) { alert('Password required!'); return false; }
	if( !$( 'company').value ) { alert('company name required!'); return false; }
	if( !$( 'firstName').value ) { alert('First Name required!'); return false; }
	if( !$( 'lastName').value ) { alert('Last Name required!'); return false; }
	if( !$( 'street').value ) { alert('Street required!'); return false; }
	if( !$( 'town').value ) { alert('Town required!'); return false; }
	if( $( 'countryCode' ).value == 'US'  &&  !$( 'state').value ) { alert('State required!'); return false; }
	if( !$( 'countryCode' ).value) { alert('country required!'); return false; }
	if( !$( 'postcode' ).value ) { alert('Postcode required!'); return false; }
	if( !$( 'phoneNumber').value ) { alert('Telephone required!'); return false; }
	if( !$( 'Cust_Bill_Email').value ) { alert('Email required!'); return false; }
	
	if( !validateEmail ( $( 'Cust_Bill_Email').value ) ) { alert('Please input a valid email address!'); return false; }
	
	if( !$( 'Shipp_Add_Same').checked ) {
		if( !$( 'ship_company').value ) { alert('Delivery address company name required!'); return false; }
		if( !$( 'ship_firstName').value ) { alert('Delivery address first name required!'); return false; }
		if( !$( 'ship_lastName').value ) { alert('Delivery address last name required!'); return false; }
		if( !$( 'ship_street').value ) { alert('Delivery address street required!'); return false; }
		if( !$( 'ship_town').value ) { alert('Delivery address town required!'); return false; }
		if( $( 'ship_countryCode' ).value == 'US'  &&  !$( 'ship_state').value ) { alert('Delivery address state required!'); return false; }
		if( !$( 'ship_postcode' ).value ) { alert('Delivery address postcode required!'); return false; }
		if( !$( 'ship_phoneNumber').value ) { alert('Delivery address telephone required!'); return false; }
	}
	
	if( !document.getElementsByName('companyStatus')[0].checked && !document.getElementsByName('companyStatus')[1].checked  ){  alert('Company status required!'); return false;}
	if( document.getElementsByName('companyStatus')[1].checked  && $('startUpTime').value == '' ){ alert('If start up, when do you start? Please select'); return false;}
	if( $('yourMarket').value=='' ){ alert('Your market, Please select!'); return false;}
	if( $('yourMarket').value=='Other' && $('yourMarketSpecify').value == '' ){ alert('Your market, if other,please specify!'); return false;}
if (!document.getElementsByName('businessModel')[0].checked && !document.getElementsByName('businessModel')[1].checked && !document.getElementsByName('businessModel')[2].checked) {
    alert('Business model? Please choose!');
    return false;
}
else {
    if (document.getElementsByName('businessModel')[0].checked) {
        if (!validateNumber( $('number_online').value)) {
           // alert("Please input online shops number(only number)");
            return false;
        }
        if (!$('url_online').value) {
            alert("Web-shops URL required!");
            return false;
        }
        
    }
    if (document.getElementsByName('businessModel')[1].checked) {
        if (!validateNumber( $('number_shop').value)) {
            //alert("Please input Brick and mortar shops Number(only number)");
            return false;
        }
        if (!$('size_shop').value) {
            alert("Shops average size required!");
            return false;
        }
        if (!$('interested_lelo').value) {
            alert("Interested in the LELO Display Solutions required!");
            return false;
        }
    }
    if (document.getElementsByName('businessModel')[2].checked) {
        if (!$('number_online').value) {
            alert("Number of online shops required!");
            return false;
        }
        if (!$('url_online').value) {
            alert("Web-shops URL required!");
            return false;
        }
        if (!$('number_shop').value) {
            alert("Number of shops required!");
            return false;
        }
        if (!$('size_shop').value) {
            alert("Shops average size required!");
            return false;
        }
        if (!$('interested_lelo').value) {
            alert("Interested in the LELO Display Solutions required!");
            return false;
        }
    }
}

	if ( !document.getElementById('agree').checked ) { 
		document.getElementById('showA').style.display = 'inline'; 
		alert( 'Please agree to the terms and conditions' );
		return false;
	}
	
	$( 'form1' ).submit();
		
}

function echeck(str) {
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
		if (filter.test(str))
			return true;
		else{
			alert("Please input a valid email address!");
			return false;		 
		}	
	}

function validateEmail( emailValue ){
	var emailID = emailValue;
	//alert( emailID );
	if ( emailID == null || emailID == ""){
		alert("Please Enter your Email")
		//emailID.focus()
		return false
	}
	if (echeck(emailID)==false){
		//emailID.value=""
		//emailID.focus()
		return false
	}
	return true
 }
function validateNumber(shopNumber){
		var filter=/^([0-9]+)$/i;
		if (filter.test(shopNumber))
		{
			return true;
			
		}
		else{
			alert("Shops number required (Please input number only)");
			return false;		 
		}
}
