/*
*   - javascript snippets gathert from all the scripts
*   - to validate page event direct JS have to be pure.
*   - this script file goes with all pages, because not sure which file which page uses.
*
*/
// site/main/menu.inc line ~28
function school_select_changed($option, $school_page_id){
	var siteroot = EDIT_CORE.JSSiteRoot.replace('https', 'http');
	var value = $option.options[$option.options.selectedIndex].value;
	if (value.indexOf('redirect_alert') != -1) {
		value = value.slice(value.lastIndexOf('_')+1);
		alert('Denne skolen har skiftet navn til Stavern folkehøyskole Fredtun');
	}
	document.location.href=siteroot+"index.php?page_id="+$school_page_id + "&skole_id="+value;
}
// site/main/menu.inc line ~7
function check_picked_course(){
	if((document.frm_school_search.chc_faginteresse.options.selectedIndex == -1)&&(document.frm_school_search.chc_kurstype.checked!=true)){
		alert('Du må velge faginteresse!');return false;
	}else { return true; }
}
// site/main/html/TD.inc line ~48
function printcontents(element){
	var win = window.open(element, "TrackHistoryData", "width=690,height=480,top=0,left=0,toolbars=yes,scrollbars=yes,status=no,resizable=yes");
	win.focus();
}

/// kursliste_for.inc
function kursliste_click($SCRIPT, $PAGE_ID, $SKOLE_ID, $KURS_ID, $PAGE_ROW_PARAM, $EXTRA_PARAM){
	location.href='../../site/'+$SCRIPT+'?page_id='+$PAGE_ID+'&skole_id='+$SKOLE_ID+'&produkt_id='+$KURS_ID+'&page_row_id='+$PAGE_ROW_PARAM+$EXTRA_PARAM;
}
