function openMultimediaWindow(site, width, height) {
	var Ausdruck = /^\/sendungen/;
	var i = Ausdruck.exec(site);
	if (i) {
	   windowOpen(site,width,height);
	} else {
	    location.href = site;
	}
}

function window_pen(url,width,height,left,top,scrollbars,location) {
	if (scrollbars != 'no') var scrollbars = 'yes';
	if (location == 1) {
		popupWindow = window.open(url,"popup","height="+height+",width="+width+",left="+left+",top="+top+",locationbar=yes,location=yes,menubar=yes,toolbar=yes,scrollbars="+scrollbars+",resizable=yes");
	} else {
		popupWindow = window.open(url,"popup", "height="+height+",width="+width+",left="+left+",top="+top+",locationbar=no,location=no,menubar=no,toolbar=no,scrollbars="+scrollbars+",resizable=no");
	}
	popupWindow.focus();
}

function windowOpen(url,name,width,height,left,top,scrollbars,location) {
	if (name == '') var name = 'popup';
	if (popupWindow != null && popupWindow.closed == false) popupWindow.close();
	if (scrollbars != 'no') var scrollbars = 'yes';
	if (location == 1) {
		popupWindow = window.open(url,name,"popup","height="+height+",width="+width+",left="+left+",top="+top+",locationbar=yes,location=yes,menubar=yes,toolbar=yes,scrollbars="+scrollbars+",resizable=yes");
	} else {
		popupWindow = window.open(url,name,"popup","height="+height+",width="+width+",left="+left+",top="+top+",locationbar=no,location=no,menubar=no,toolbar=no,scrollbars="+scrollbars+",resizable=no");
	}
	popupWindow.focus();
}

function winTarget(url,name,width,height,left,top,scrollbars) {

	if (scrollbars != 'no') var scrollbars = 'yes';
	if (name == '') var name = 'popup';
	if (popupWindow != null && popupWindow.closed == false) popupWindow.close();
	
	popupWindow = window.open(url, name, "height="+height+",width="+width+",left="+left+",top="+top+",location=no,menubar=no,scrollbars="+scrollbars+",resizable=no");
	popupWindow.focus();
}

function winOpen(url,name,width,height,left,top,scrollbars) {

	if (scrollbars != 'no') var scrollbars = 'yes';
	if (name == '') var name = 'popup';
	if (popupWindow != null && popupWindow.closed == false) popupWindow.close();
	
	popupWindow = window.open(url, name, "height="+height+",width="+width+",left="+left+",top="+top+",location=no,menubar=no,scrollbars="+scrollbars+",resizable=yes");
	popupWindow.focus();
	window.close();
}

function winSubmit(url,name,width,height,left,top,scrollbars) {

	if (scrollbars != 'no') var scrollbars = 'yes';
	if (name == '') var name = 'popup';
	if (popupWindow != null && popupWindow.closed == false) popupWindow.close();
	
	popupWindow = window.open(url, name, "height="+height+",width="+width+",left="+left+",top="+top+",locationbar=no,menubar=no,scrollbars="+scrollbars+",resizable=yes");
	popupWindow.focus();
	window.close();
}

function win_pen(url,name,width,height,scrollbars) {

	if (scrollbars != 'no') var scrollbars = 'yes';
	if (name == '') var name = 'popup';
	if (popupWindow != null && popupWindow.closed == false) popupWindow.close();
	
	popupWindow = window.open(url, name, "height="+height+",width="+width+",locationbar=no,menubar=no,scrollbars="+scrollbars+",resizable=yes");
	popupWindow.focus();
}
var popupWindow = null;


function winLocation(url) { 

	window.location.href=url; 
} 

function resize(width,height,xpos,ypos) {

window.resizeTo(width,height);
window.moveTo(xpos,ypos);
}

function fullWin(URL,WIDTH,HEIGHT) {

	fullWin=window.open(URL,"Large","toolbar=no,width="+WIDTH+",height="+HEIGHT+",top=0,left=0,status=no,resizable=0,scrollbars=1,menubar=1,toolbar=1,location=1,directories=1,status=0");
	fullWin.focus();
	self.close(); 
} 

function openWin(URL) { 

	TermsWindow=window.open(URL,"Large","toolbar=no,width=688,height=456,top=0,left=0,status=no,scrollbars=no,resize=yes,menubar=no");
} 

function openScrollWin(URL,WINNAME,WIDTH,HEIGHT) { 

		scrollWin=window.open(URL, "popUpWindow", "toolbar=no, width=" + WIDTH + ", height=" + HEIGHT + ",top=0,left=0,status=no,scrollbars=yes,resize=no,menubar=no");
		scrollWin.focus();
} 

function openShortMessage(URL) { 

	TermsWindow=window.open(URL,"Large","toolbar=no,width=400,height=140,top=0,left=0,status=no,scrollbars=no,resize=yes,menubar=no");
} 

function loginMail(url) {
winTarget(url,'SEND',720,700,80,30,'yes');
winLocation('http://truelovethailand.com/member.php');
} 

function confirmSent() { 

	alertBox('Your Message has been delivered and an email has been sent'); 
}

function alertBox(TEXT) { 

	alert("" + TEXT + "");
	window.close(); 
} 

function openChild(file,window) { 

	childWindow=open(file,window,'resizeable=yes,width=700,height=620'); 
	if (childWindow.opener == null) childWindow.opener = self; 
} 


function updateParent() { 

	opener.document.parentForm.mailid.value = document.childForm.mailid.value; 
	opener.document.parentForm.resultpage.value = document.childForm.resultpage.value; 
	opener.document.parentForm.box.value = document.childForm.box.value; 
	opener.document.parentForm.profile.value = document.childForm.profile.value; 
	opener.document.parentForm.button.value = document.childForm.button.value; 
	opener.document.parentForm.submit() 

	return false; 
}

function submitParent() { 

	opener.document.parentForm.mailid.value = document.childForm.mailid.value; 
	opener.document.parentForm.resultpage.value = document.childForm.resultpage.value; 
	opener.document.parentForm.box.value = document.childForm.box.value; 
	opener.document.parentForm.profile.value = document.childForm.profile.value; 
	opener.document.parentForm.button.value = 'submit'; 
	opener.document.parentForm.submit() 

	return false; 
}

function newChild() { 

	openChild('send.php?msgid=566&box=in&ctrl=off','win2'); 
}

var windowReference;

function open_Popup() { 

	windowReference = window.open('send.php','windowName'); 
	if (!windowReference.opener) 
	windowReference.opener = self; 
} 

function openActive(url,name,width,height,left,top,scrollbars) {

	if (scrollbars != 'no') var scrollbars = 'yes';
	windowReference = window.open(url, name, "height="+height+",width="+width+",left="+left+",top="+top+",locationbar=no,menubar=no,scrollbars="+scrollbars+",resizable=yes");
	windowReference.focus();
	if (!windowReference.opener) 
	windowReference.opener = self; 
}


// neue Fenster ankuendigen
function popupLinkTitleAnpassen() {
    if (document.getElementById) {
        var anker = '';
        for(var i=0; i<document.links.length; i++) {
            anker += document.links[i].className;
            var blank = ' ';
            if (document.links[i].title == '') {
                blank = '';
            }
            if (document.links[i].className.indexOf('multimediaFenster') != -1 || document.links[i].className.indexOf('lupe') != -1) {
                document.links[i].title = document.links[i].title + blank + '[neues Fenster]';
            }
        }
    }
}

temp = window.onload;
counter22 = 0;
window.onload = function() {
if(temp != null && counter22 == 0) {
counter22++;
temp();
}
popupLinkTitleAnpassen();
}

