function chkCVC(){

	if(document.getElementById('rdblCVC_0').checked == true){
		if(document.getElementById('txtCVC').value.length <=2 || document.getElementById('txtCVC').value.length >3){
			document.getElementById('btnNext').style.visibility = "hidden";
			document.getElementById('divShowErr').innerHTML = "Du har matat in "+ document.getElementById('txtCVC').value.length + " siffror i CVC koden. Tar endast 3 tecken för VISA/MasterCard. \nKlicka på OK för att verifera kod."
			document.getElementById('divShowErr').style.visibility = "visible";
			document.getElementById('btnOK').style.visibility = "visible";
			//alert("Du har matat in "+ document.getElementById('txtCVC').value.length + " siffror i CVC koden.\nTar endast 3 tecken för VISA/MasterCard." );
		}else{
			document.getElementById('divShowErr').style.visibility = "hidden";
			document.getElementById('btnNext').style.visibility = "visible";
			//document.getElementById('btnOK').style.visibility = "visible";
		}
	}
	if(document.getElementById('rdblCVC_1').checked == true){
		if((document.getElementById('txtCVC').value.length <=3) || document.getElementById('txtCVC').value.length >4){
			document.getElementById('btnNext').style.visibility = "hidden";
			document.getElementById('divShowErr').innerHTML = "Du har matat in "+ document.getElementById('txtCVC').value.length + " siffror i CVC koden. Tar endast 4 tecken för AMEX.\nKlicka på OK för att verifera kod."
			document.getElementById('divShowErr').style.visibility = "visible";
			document.getElementById('btnOK').style.visibility = "visible";
			//alert("Du har matat in "+ document.getElementById('txtCVC').value.length + " siffror i CVC koden.\nTar endast 4 tecken för AMEX." );
		}else{
			document.getElementById('divShowErr').style.visibility = "hidden";
			document.getElementById('btnNext').style.visibility = "visible";
			//document.getElementById('btnOK').style.visibility = "visible";
		}
	}
}						
function showNext(){
	if (chkCVC){
		//document.getElementById('btnNext').style.visibility = "visible";
	}	
}
function EmptyChkCVC(){
	document.getElementById('txtCVC').value = "";				
}
function checkForResize() {
	oldHeight = generics.docHeight;
	generics.syncAll();					
	if( oldHeight != generics.docHeight ) {
		meny.width = generics.docWidth - 10;
		meny.height = generics.docHeight;
		meny.paint();
	}
}
function openWindow( strUrl, intWidth, intHeight ){
	window.open(strUrl,'winPopup','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,width='+ intWidth + ',height=' + intHeight +',copyhistory=no');
}
function openRemoteWindow( strUrl, intWidth, intHeight ){
	remote = window.open('','winPopup','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,width='+ intWidth + ',height=' + intHeight +',copyhistory=no');
	remote.location.href = strUrl;
	if (remote.opener == null) remote.opener = window;
	remote.opener.name = "opener";	
}
function SwitchContent(DivIndex){
	var Div = document.getElementById("ContentDiv" + DivIndex);
	if(Div.style.display == 'block'){
		Div.style.display = 'none';
	}else{
		Div.style.display = 'block';
	}
}
function openParent( strUrl ){
	opener.document.location.href = strUrl;
	//window.close();
}
function BubbaGump(B,BQ){
    if (BQ==1){
        B.style.color='Blue';
    } 

    if (BQ==0){
        B.style.color='#222288';
    }
} 
function CaricaFoto(img){
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}
function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewFoto(img){
  largh=foto1.width+20;
  altez=foto1.height+20;
  stringa="width="+largh+",height="+altez;
  finestra=window.open(img,"",stringa);
}
function btnPkgClick(){
	window.open("http://server.logistik.posten.se/servlet/PacTrack?kolliid=" + document.getElementById('kolliid').value + "&lang=SE&xslURL=/xsl/pactrack/standard.xsl&cssURL=http://www.babyland.se/styles/main_style.css","winPopup","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,width=600,height=600,copyhistory=no");
}
function switchLanguage(lng){
    str = "";
    if(lng == "EN"){
        str = "            <span class=\"blueRub\">Welcome to Babyland.se</span> &nbsp;&nbsp;<a href=\"javascript:void(0);\" onclick=\"switchLanguage('SE');return false;\" style=\"text-decoration: none;\">(Svenska)</a><br/><br/>";
        str += "<span class=\"bread\">Babyland has since the start in 1986 been Sweden's leading retail chain for families with small children.<br/><br/>";
        str += "The stores product ranges are specially selected to attract both families with children and our own requirements. If you visit any of our stores in Sweden you will also notice that our staff is specially selected.<br/><br/>";
        str += "The product ranges are constantly under development and might not always be the same as in our stores.<br/><br/>";
        str += "Since the web shop are in Swedish it mainly turns to people how know the language, but if you do find a product that you want to buy you're certainly welcome. And if you need help you can always send us an e-mail or phone.<br/><br/>";
        str += "A warm welcome to our family!";
        str += "</span>";
        document.getElementById("base1").innerHTML = str;
    }else{
        str = "            <span class=\"blueRub\">V&auml;lkommen till Babyland.se</span> &nbsp;&nbsp;<a href=\"javascript:void(0);\" onclick=\"switchLanguage('EN');return false;\" style=\"text-decoration: none;\">(English)</a><br/><br/>";
        str += "<span class=\"bread\">Babyland har sedan 1986 varit Sveriges ledande butiker med kvalitetsprodukter f&ouml;r barnfamiljer.<br/><br/>";
        str += "Produkterna i v&aring;ra butiker &auml;r noga utvalt f&ouml;r att uppfylla sm&aring;barnf&ouml;r&auml;ldrars h&ouml;ga krav. Och bes&ouml;ker du n&aring;gon av v&aring;ra butiker runt om i Sverige uppt&auml;cker du &auml;ven att v&aring;r personal &auml;r noga utvald!<br/><br/>";
        str += "I v&aring;r n&auml;tbutik har vi ett webbsortiment som &auml;r lite smalare &auml;n butikernas, men det ut&ouml;kas l&ouml;pande.<br/><br/>";
        str += "Varmt v&auml;lkommen till v&aring;r familj!";
        str += "</span>";
        document.getElementById("base1").innerHTML = str;
    }
}
