var orgWidth = 300;
var orgHeight = 436;

function resizeSign() {
	if ($(window).width() > 1000) {
		ratio		= parseFloat($(window).width()/$("#contentContainer").width());
		imgWidth	= Math.ceil(orgWidth * ratio);
		imgHeight	= Math.ceil(orgHeight * ratio);
		$("#rfSign").css({"width": imgWidth + "px", "height": imgHeight +"px" });
	}
}

$(document).ready(function(){
	resizeSign();
	
	$("a").attr({ onfocus: "this.blur();"});
	
	$("A#musicLink").hover(function(){
		$("A#campusLink").toggleClass("hover");
		$("A#artsLink").toggleClass("hover");
	});
	$("A#campusLink").hover(function(){
		$("A#musicLink").toggleClass("hover");
		$("A#artsLink").toggleClass("hover");
	});
	$("A#artsLink").hover(function(){
		$("A#musicLink").toggleClass("hover");
		$("A#campusLink").toggleClass("hover");
	});
});

$(window).resize(resizeSign);

function showTrailer() {
	$("#trailer").hide();
	$("#trailerContainer").show(500, function() {
		$("#outerContainer").height($(document).height());
		$("#iFrameTrailer").attr("src","rf_trailer.html"); 
		document.location.hash="#movie";
	});
}

/* Akkreditierung */
function check_acc(formName,myLang) {
	if (document.forms[formName].elements['date1'].checked == false && document.forms[formName].elements['date2'].checked == false && document.forms[formName].elements['date3'].checked == false) {
		'd' == myLang?alert("Bitte Festivaltag(e) auswählen."):alert("Please choose accreditation day(s).");
		document.getElementById('date1Label').style.color = "red";
		document.getElementById('date2Label').style.color = "red";
		document.getElementById('date3Label').style.color = "red";
		document.location.hash='#date1';
		document.forms[formName].elements['date1'].focus();
		return false;
	}
	else if (document.forms[formName].elements['interest[]'][0].checked == false && document.forms[formName].elements['interest[]'][1].checked== false) {
		'd' == myLang?alert("Bitte besonderes Interesse auswählen."):alert("Please choose special interest.");
		document.getElementById('interest1Label').style.color = "red";
		document.getElementById('interest2Label').style.color = "red";
		document.getElementById('interest3Label').style.color = "red";
		document.location.hash='#interest';
		document.forms[formName].elements['interest1'].focus();
		return false;
	}
	else if (document.forms[formName].elements['medium_name'].value == "") {
		'd' == myLang?alert("Bitte Name des Mediums ausfüllen."):alert("Please fill in the medium name.");
		document.forms[formName].elements['medium_name'].style.border = "1px solid red";
		document.location.hash='#medium_name';
		document.forms[formName].elements['medium_name'].focus();
		return false;
	}
	else if (document.forms[formName].elements['editorial_contactperson'].value == "") {
		'd' == myLang?alert("Bitte die Redaktionsleitung angeben."):alert("Please fill in the chief editor.");
		document.forms[formName].elements['editorial_contactperson'].style.border = "1px solid red";
		document.location.hash='#editorial_contactperson';
		document.forms[formName].elements['editorial_contactperson'].focus();
		return false;
	}
	else if (document.forms[formName].elements['editorial_street'].value == "") {
		'd' == myLang?alert("Bitte Straße ausfüllen."):alert("Please fill in the street.");
		document.forms[formName].elements['editorial_street'].style.border = "1px solid red";
		document.location.hash='#editorial_street';
		document.forms[formName].elements['editorial_street'].focus();
		return false;
	}
	else if (document.forms[formName].elements['editorial_zip'].value == "") {
		'd' == myLang?alert("Bitte Postleitzahl ausfüllen."):alert("Please fill in the postal code / zip.");
		document.forms[formName].elements['editorial_zip'].style.border = "1px solid red";
		document.location.hash='#editorial_zip';
		document.forms[formName].elements['editorial_zip'].focus();
		return false;
	}
	else if (document.forms[formName].elements['editorial_city'].value == "") {
		'd' == myLang?alert("Bitte Stadt ausfüllen."):alert("Please fill in the city.");
		document.forms[formName].elements['editorial_city'].style.border = "1px solid red";
		document.location.hash='#editorial_city';
		document.forms[formName].elements['editorial_city'].focus();
		return false;
	}
	else if (myLang != 'd' && document.forms[formName].elements['editorial_country'].value == "") {
		alert("Please fill in where your headoffice is based in.");
		document.forms[formName].elements['editorial_country'].style.border = "1px solid red";
		document.location.hash='#editorial_country';
		document.forms[formName].elements['editorial_country'].focus();
		return false;
	}
	else if (document.forms[formName].elements['editorial_mail1'].value == "") {
		'd' == myLang?alert("Bitte E-Mail-Adresse des Mediums ausfüllen."):alert("Please fill in the email for your medium.");
		document.forms[formName].elements['editorial_mail1'].style.border = "1px solid red";
		document.location.hash='#editorial_mail1';
		document.forms[formName].elements['editorial_mail1'].focus();
		return false;
	}
	else if (document.forms[formName].elements['firstname'].value == "") {
		'd' == myLang?alert("Bitte Vorname ausfüllen."):alert("Please fill in your firstname.");
		document.forms[formName].elements['firstname'].style.border = "1px solid red";
		document.location.hash='#firstname';
		document.forms[formName].elements['firstname'].focus();
		return false;
	}
	else if (document.forms[formName].elements['lastname'].value == "") {
		'd' == myLang?alert("Bitte Nachname ausfüllen."):alert("Please fill in your surname.");
		document.forms[formName].elements['lastname'].style.border = "1px solid red";
		document.location.hash='#lastname';
		document.forms[formName].elements['lastname'].focus();
		return false;
	}
	else if (document.forms[formName].elements['function'].value == "") {
		'd' == myLang?alert("Bitte Funktion ausfüllen."):alert("Please fill in your function.");
		document.forms[formName].elements['function'].style.border = "1px solid red";
		document.location.hash='#function';
		document.forms[formName].elements['function'].focus();
		return false;
	}
	/*else if (document.forms[formName].elements['photo'].value == "") {
		'd' == myLang?alert("Bitte laden Sie ein Foto hoch."):alert("Please upload your photo.");
		document.forms[formName].elements['photo'].style.border = "1px solid red";
		document.location.hash='#photo';
		document.forms[formName].elements['photo'].focus();
		return false;
	}*/
	else if (document.forms[formName].elements['editorial_phone'].value == "") {
		'd' == myLang?alert("Bitte Telefon ausfüllen."):alert("Please fill in your phone number.");
		document.forms[formName].elements['editorial_phone'].style.border = "1px solid red";
		document.location.hash='#editorial_phone';
		document.forms[formName].elements['editorial_phone'].focus();
		return false;
	}
	else if (document.forms[formName].elements['editorial_cellphone'].value == "" || document.forms[formName].elements['editorial_cellphone'].value.length <= 10) {
		'd' == myLang?alert("Bitte geben Sie Ihre Mobilnummer an, damit wir Sie ggf. auf dem Festivalgelände erreichen können."):alert("Please fill in your cellphone number so we can get in touch with you during the Festival.");
		document.forms[formName].elements['editorial_cellphone'].style.border = "1px solid red";
		document.location.hash='#editorial_cellphone';
		document.forms[formName].elements['editorial_cellphone'].focus();
		return false;
	}
	else if (document.forms[formName].elements['editorial_mail'].value == "") {
		'd' == myLang?alert("Bitte E-Mail ausfüllen."):alert("Please fill in your email.");
		document.forms[formName].elements['editorial_mail'].style.border = "1px solid red";
		document.location.hash='#editorial_mail';
		document.forms[formName].elements['editorial_mail'].focus();
		return false;
	}
	else if (document.forms[formName].elements['medium_type'].options[document.forms[formName].elements['medium_type'].selectedIndex].value == "") {
		'd' == myLang?alert("Bitte Medium-Typ auswählen."):alert("Please fill in your medium type.");
		document.forms[formName].elements['medium_type'].style.border = "1px solid red";
		document.location.hash='#medium_type';
		document.forms[formName].elements['medium_type'].focus();
		return false;
	}
	else if ( (document.forms[formName].elements['medium_type'].options[document.forms[formName].elements['medium_type'].selectedIndex].value == "Andere") && (document.forms[formName].elements['medium_other'].value == "") ) {
		'd' == myLang?alert("Bitte den Mediumstypen spezifizieren."):alert("Please specify medium type.");
		document.forms[formName].elements['medium_other'].style.border = "1px solid red";
		document.location.hash='#medium_other';
		document.forms[formName].elements['medium_other'].focus();
		return false;
	}
	else if ( (document.forms[formName].elements['broadcast_type'].options[document.forms[formName].elements['broadcast_type'].selectedIndex].value == "TV") && (document.forms[formName].elements['medium_crew'].value == "") ) {
		'd' == myLang?alert("Bitte Anzahl der Crew-Mitglieder angeben."):alert("Please fill in the number of crew members.");
		document.forms[formName].elements['medium_crew'].style.border = "1px solid red";
		document.location.hash='#medium_crew';
		document.forms[formName].elements['medium_crew'].focus();
		return false;
	}
	else if (document.forms[formName].elements['medium_scope'].value == "") {
		'd' == myLang?alert("Bitte Auflage / Reichweite ausfüllen."):alert("Please fill in numbers of copies / media scope.");
		document.forms[formName].elements['medium_scope'].style.border = "1px solid red";
		document.location.hash='#medium_scope';
		document.forms[formName].elements['medium_scope'].focus();
		return false;
	}
	else if (document.forms[formName].elements['report_date'].value == "") {
		'd' == myLang?alert("Bitte Datum oder Zeitraum der geplanten Berichterstattung ausfüllen."):alert("Please fill in date of coverage.");
		document.forms[formName].elements['report_date'].style.border = "1px solid red";
		document.location.hash='#report_date';
		document.forms[formName].elements['report_date'].focus();
		return false;
	}
	else if (document.forms[formName].elements['department'].value == "") {
		'd' == myLang?alert("Bitte Ressort ausfüllen."):alert("Please fill in your department.");
		document.forms[formName].elements['department'].style.border = "1px solid red";
		document.location.hash='#department';
		document.forms[formName].elements['department'].focus();
		return false;
	}
	
	return true;
}

