function validateForm(form) {
	var d = parseInt( form.SrchFromDay.value )
	var m = parseInt( form.SrchFromMonth.value )
	var j = parseInt( form.SrchFromYear.value )

	if ( !checkDate(d,m,j) ) {
		alert("Datum inkorrekt!") ;
		form.SrchFromDay.focus();
		return false;
	}
}

function checkDate( d, m, j ) {
	var dt = new Date( j, m-1, d )
	if ( dt.getDate() != d || dt.getMonth()+1 != m ) return false;
	return true;
}

function setCurrentDay() {
	//
	// Set Quickfinder date to current day
	//
	var today = new Date();
	var today_day   = today.getDate();
	var today_month = today.getMonth();
	var today_year  = today.getFullYear();

	window.document.frmQuickFind.SrchFromDay.options[today_day-1].selected = true;
	window.document.frmQuickFind.SrchFromMonth.options[today_month].selected = true;
	window.document.frmQuickFind.SrchFromYear.options[0].value = today_year;
	window.document.frmQuickFind.SrchFromYear.options[0].text = today_year;
}

function submitFORM()
{
		
       	OC = document.frmQuickFind.OC.value;
       	ID = document.frmQuickFind.IDSelect.value;
        RG = document.frmQuickFind.RG.value;
        FN = document.frmQuickFind.FN.value;
        CF = "SPHERESELL";
        LG = document.frmQuickFind.LG.value;
        if (document.getElementById("FC1").checked) {
        	FC = document.getElementById("FC1").value;
        } else {
        	FC = document.getElementById("FC2").value;
        }
        //alert(ID);
		if (ID.indexOf(",") == -1) {
			RG = "DN";
		}
        sfd = document.frmQuickFind.SrchFromDay.value;
        sfm = document.frmQuickFind.SrchFromMonth.value;
        sfy = document.frmQuickFind.SrchFromYear.value;
        sd = document.frmQuickFind.SrchDays.value;
       	sr = document.frmQuickFind.SrchRooms.options[document.frmQuickFind.SrchRooms.selectedIndex].text;
        sp = document.frmQuickFind.SrchPax.options[document.frmQuickFind.SrchPax.selectedIndex].text;
        sbo = document.frmQuickFind.SrchBookOnly.checked;
       
        url = "http://feratel-sellrain.concentrator.net/a2t2/tosc.asp?TOSCNEW=TRUE&PLANNER=TRUE&OC=" + OC + "&ID=" + ID + "&RG=" + RG + "&FN=" + FN;
        url = url + "&CF=" + CF + "&LG=" + LG + "&FC=" + FC + "&SrchFromDay=" + sfd + "&SrchFromMonth=" + sfm;
        url = url + "&SrchFromYear=" + sfy + "&SrchDays=" + sd + "&SrchRooms=" + sr + "&SrchPax=" + sp;
        url = url + "&SrchBookOnly=" + sbo;
        //alert(url);
		
        myLightWindow.activateWindow({
            href: url,
            title: 'Suchen & Buchen',
            author: 'Spherecast',
            opacity:70,
            caption: '',
            width:850,
            height:500,
            top:340
        });
		//resetNav();
		//F1 = window.open(url,"TOSC","width=830,height=600,left=200,top=100,location=no, menubar=yes, toolbar=yes, scrollbars=yes, resizable=yes");                    
}