
	// Öffnet Antragsformular in neuem Fenster; US 14.05.2009
	function ShowAntrag(url, w, h, name, scroll) {
		NewWin = window.open(url,name,"width="+w+",height="+h+",scrollbars="+scroll+",status=no,toolbar=no,menubar=no,resizable=yes");
		NewWin.focus();
	}

	function PicPrev(url, src) {
		url = url + "?src=" + src;
		NewWindow(url, 100, 100, "showimg", "yes");
	}

	function NewWindow(url, w, h, name, scroll) {
		NewWin = window.open(url,name,"width="+w+",height="+h+",scrollbars="+scroll+",status=no,toolbar=no,menubar=no,resizable=yes");
		NewWin.focus();
	}

	function preview() {
		// url = p + ";bPrint:1";
		//url = p + "&iPrint=1"; US 25.11.2008
		url = p; // US 25.11.2008
		printWin = window.open(url+".htm?fCreditAmount=5000&iCreditDuration=60&iPrint=1", "printpage", "width=1024,height=600,scrollbars=yes,status=no,toolbar=no,menubar=yes,resizable=yes");
		printWin.focus();
		setTimeout("",1000);
	}

	function search() {
		document.frmSearch.submit();
	}

	function newwin(w,h) {
		myparm = 'width='+ w +',height='+ h +',scrollbars=no,status=no,toolbar=no,menubar=no'
		mywindow=window.open('','newwin',myparm)
		mywindow.focus();
	}


	// SELECT CREDIT TYPE
	function goOnOverviewPageSommer(iKredit){

//	alert( this.hash ); //return #123
//	alert(window.location.hash )

		// default settings for rechner
		if(!iKredit) iKredit = 1;
		var iDefCreditAmount = 5000;
		var iDefCreditDuration = 72;
		var TrackUrl = "";

		//var TrackUrlPath = "http://ikano-sommer/kredit/kreditantrag.htm";
		//var TrackUrlPath = "http://"+location.host+"/kredit/kreditantrag.htm";
		var TrackUrlPath = "http://"+location.host+"/landing-kreditrechner.php";
		//alert(iKredit);

		set_hash(location.host.href)


		if(iKredit==1) { // Default Values Rechner
			var iDefCreditAmount = 5000;
			var iDefCreditDuration = 60;
			var iDefLCsType = 1;
			TrackUrl =  TrackUrlPath+"?fCreditAmount="+iDefCreditAmount+"&iCreditDuration="+iDefCreditDuration+"&iLCsType="+iDefLCsType;
		}
		else if(iKredit==2) { // Beamtenkredit
			var iDefCreditAmount = 7500;
			var iDefCreditDuration = 60;
			var iDefLCsType = 2;
			TrackUrl =  TrackUrlPath+"?fCreditAmount="+iDefCreditAmount+"&iCreditDuration="+iDefCreditDuration+"&iLCsType="+iDefLCsType;
		}
		else if(iKredit==3) { // Sommer-Speciell 1
			var iDefCreditAmount = 5000;
			var iDefCreditDuration = 48;
			var iDefLCsType = 3;
			TrackUrl =  TrackUrlPath+"?fCreditAmount="+iDefCreditAmount+"&iCreditDuration="+iDefCreditDuration+"&iLCsType="+iDefLCsType;
		}
		else if(iKredit==4){ // Sommer-Speciell 2
			var iDefCreditAmount = 10000;
			var iDefCreditDuration = 60;
			var iDefLCsType = 4;
			TrackUrl =  TrackUrlPath+"?fCreditAmount="+iDefCreditAmount+"&iCreditDuration="+iDefCreditDuration+"&iLCsType="+iDefLCsType;
		}
		else if(iKredit==5) {
			var iDefCreditAmount = 5000;
			var iDefCreditDuration = 48;
			var iDefLCsType = 5;
			TrackUrl =  TrackUrlPath+"?fCreditAmount="+iDefCreditAmount+"&iCreditDuration="+iDefCreditDuration+"&iLCsType="+iDefLCsType;
		}
		else if(iKredit==6) {
			var iDefCreditAmount = 10000;
			var iDefCreditDuration = 60;
			var iDefLCsType = 6;
			TrackUrl =  TrackUrlPath+"?fCreditAmount="+iDefCreditAmount+"&iCreditDuration="+iDefCreditDuration+"&iLCsType="+iDefLCsType;
		}

		location.href = TrackUrl;
		location.replace(TrackUrl);

		//alert(TrackUrl);

	}


		// hash code
		var current_hash = window.location.hash;

		function check_hash() {
			if ( window.location.hash != current_hash && window.location.hash!=undefined) {
				current_hash = window.location.hash;
				//page_change( current_hash.substr( 1,  current_hash.length) );
				//set_hash( current_hash.substr( 1,  current_hash.length) );
			}
		}

		hashCheck = setInterval( "check_hash()", 50 );

		function set_hash( new_hash ) {
			current_hash = new_hash
			window.location.hash = new_hash;
		}



		// Trackind PDF
		function getAjaxTrackIkano(idtrack){

			partnercode.location.href = "http://"+location.host+"/partner_track.php?idtrack="+idtrack;

			/*
			$.ajax({
				type: "GET",
				url: "http://"+location.host+"/partner_track.php?idtrack="+idtrack,
				//dataType: "html",
				data: "",
				cache: false,
				success: function(response){
					//alert(location.host);
					//$("#jsTrackBox").html(response);
				}
			});
			*/
		}


		function getFile(file,count){
			//var count = 2;
			if(!count) var count = 2;
			var timer = null;

			function countdown() {

				if (count >= 0) {
					count--;
					//$("#time").text(count);
				}
				else {
					window.clearInterval(timer); // stop the timer
					//window.open(file,"Download"); // Öffnet das PDF in einem neuen Fenster
					location.href= file; // Öffnet das PDF in einem neuen Fenster
					return false;
				}
			}
			timer = window.setInterval(countdown, 1000);
		}

		// vasic call for download url
		function getTrCode(idtrack,file,count){
			//alert('download startet...');
			//$("#jsTrackBox").html(idtrack);
			getAjaxTrackIkano(idtrack);
			getFile(file,count);
		}
