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");
}
