
		function newWin (sPath) {
			window.open(sPath,'');
			s=s_gi(_rootAccount);cLT(s,1,'Default');
			}

		function newWinSite (sPath,sCompany) {
			window.open(sPath,'');
			s=s_gi(_rootAccount);cLT(s,1,sCompany);
		}


		function LoadUrl (id,sCompany) {
			window.open('http://www.alltomlinser.se/LoadUrl.asp?id=' + id,'');
			s=s_gi(_rootAccount);cLT(s,1,sCompany);
		}


		function LoadPage (rid,sCompany) {
			window.open('http://www.alltomlinser.se/LoadUrl.asp?rid=' + rid,'');
			s=s_gi(_rootAccount);cLT(s,1,sCompany);
		}

		function ShowLensInfo (sProduct) {
			window.open('http://www.alltomlinser.se/linsInfo.asp?sProduct=' +sProduct,'Linser','width=350,height=300,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
			}

		function ShowFreightInfo () {
			window.open('http://www.alltomlinser.se/fri_frakt.asp','Linser','width=400,height=200,toolbar=0,location=0,directories=0,addrbar=0, statusbar=0,menubar=0,scrollbars=0,resizable=0');
			}

		function ReadMore(spath){
			window.open(spath,'');
			}

		function openMap (sPath) {
			window.open(sPath,'');
		}

		function showPop(u,w,h){ 
			mywin = window.open(u,"pop",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=600,height=500'); 
			}

		function showMail(u,w,h){ 
			mywin = window.open(u,"pop",'toolbar=0,location=no,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=200,height=200'); 
			}

		function showDelicious(u,w,h){ 
			mywin = window.open(u,"pop",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=800,height=500'); 
			}
		function showTool(u,w,h){ 
			mywin = window.open(u,"pop",'toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=800,height=500'); 
			}
		function createLead() {
			var leadNumber = Math.round((new Date().getTime() * Math.random())); 
                        var uri="http://tbl.tradedoubler.com/report?program=58052&event=80989&leadNumber=" + leadNumber;  
                        document.getElementById('tb').src = uri; 
			}

function increaseFontSize() {
   var min=9;
   var max=18;
   var p = document.getElementsByTagName('p');

   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 11;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }


}
function decreaseFontSize() {
   var min=9;
   var max=18;
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 11;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
} 

		function ShowOptMeta(id){
			imgsrc = document.getElementById('img_' + id);
			dom=document.getElementById('meta_' + id).style;

			if (dom.display == "" || dom.display == "block" || dom.display == "table-row"){
				dom.display = "none";
				dom.visibility = "hidden";
				imgsrc.src = '/images/expand.gif';
			}else{
				dom.display = "";
				dom.visibility = "visible";
				imgsrc.src = '/images/collapse.gif';
				}
			}

		function LoadOptician (id,sCompany) {
			window.open('http://www.alltomlinser.se/LoadOptician.asp?id=' + id,'');
			s=s_gi(_rootAccount);cLT(s,1,sCompany);
		}

	    	function addtofav(sUrl,sTitle){
		    	var bookmarkurl = sUrl;
    			var bookmarktitle = sTitle;
    			if (document.all) window.external.AddFavorite(bookmarkurl,bookmarktitle);
		    	}


		function EnableSubmit() {
			var btnSubmit=document.getElementById('search_go');
			var txt=document.getElementById('tzip');
			btnSubmit.disabled=false;
			btnSubmit.src='/images/btn_search.jpg';
			}


		function reviewForm(){
			//imgsrc = document.getElementById('img_' + id);
			dom=document.getElementById('review_form').style;
			sSaved=document.getElementById('rec_saved');
		
			

			if (dom.display == "" || dom.display == "block" || dom.display == "table-row"){
				dom.display = "none";
				dom.visibility = "hidden";
				//imgsrc.src = '/images/expand.gif';
			}else{
				dom.display = "";
				dom.visibility = "visible";
				//imgsrc.src = '/images/collapse.gif';
				}


			if (sSaved == undefined) {
				return;
				}

			sSaved.style.display='none';
			}


		function RefreshImage(valImageId) {
			var objImage = document.images[valImageId];
			if (objImage == undefined) {
				return;
			}
			var now = new Date();
			objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
			}

		function checkCaptcha(captcha) {
			dom=document.getElementById('captchacode');
			frm=document.getElementById('frmCaptcha');
			lbl=document.getElementById('CaptchaErr');

			if (dom.value==captcha) {
				document.frmCaptcha.submit();				
				}
			else {
				lbl.style.display="inline";
				}
			}


		function checkform() {
			var i=0;
			var temail=document.getElementById('txtepost');
			var tname=document.getElementById('txtname');
			var trec=document.getElementById('tarec');
			var tcap=document.getElementById('captchacode');

			var lblname=document.getElementById('lblname').style;
			var lblemail=document.getElementById('lblepost').style;
			var lblrec=document.getElementById('lblrec').style;
			var lblcap=document.getElementById('CaptchaErr').style;

			lblname.display='none';
			lblemail.display='none';
			lblrec.display='none';
			lblcap.display='none';

			if (tname.value=='') {
				lblname.display='inline';
				return false;
			}

			else if (temail.value=='') {
				lblemail.display='inline';
				return false;
			}

			else if (trec.value=='') {
				lblrec.display='inline';
				return false;
			}

			else if (tcap.value=='') {
				lblcap.display='inline';
				return false;
			}
			else if (validate_email(txtEpost)=false) {
				lblemail.text='fel';
				return false;
			}

			else if (echeck(temail.value)==false){
				lblemail.display='inline';
				return false;
			}	
		
			return true;

		}


	function echeck(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

