var isSafari = /safari/i.test(navigator.userAgent);

function openNews(pID) {
	var w = self.open('news/' + pID, 'newspop', 'width=350,height=' + (isSafari ? 515 : 500) + ',scrollbars=0,toolbar=0,location=0,status=1,resizable=0');
	w.focus();
}

function openJob(pID) {
	var jobWin = self.open('job_detail.php?id=' + pID, 'pop', 'width=350,height=' + (isSafari ? 515 : 500) + ',scrollbars=0,toolbar=0,location=0,status=1,resizable=0');
	jobWin.focus();
}

function openExtranet() {
	var extraWin = self.open('http://extra.yearning.de', 'extrapop', 'width=800,height=700');
	extraWin.focus();
}

function openBigPic(pProjectID, pSampleID, pLang) {
	var bigPicWin = self.open('/ref_detail.php?refID=' + pProjectID + '&sampleID=' + pSampleID + '&lang=' + pLang, 'projectpop', 'width=800,height=600,scrollbars=0,toolbars=0,resizable=0,status=1');
	bigPicWin.focus();
}

function openInBildernDetail(pID, pLang) {
	//self.alert(pID + " / " + pLang);
	var ibDetailWin = self.open('/in-bildern_detail.php?sampleID=' + pID + '&lang=' + pLang, 'ibpop', 'width=800,height=600,scrollbars=0,toolbars=0,resizable=0,status=1');
	ibDetailWin.focus();
}

function switchLang(pLang) {
	var url = self.location.href;
	url = url.split(self.location.host)[1];
	url = url.replace(/\/de\/|\/en\//, '/' + pLang + '/');

	self.location = url;
}
