﻿function edit(PageID, ElementType, ElementID, Category){
	if (ElementType == "text") {
		fenster2=window.open("/edit/edittext.aspx?type=text&pageid="+PageID+"&ElementID="+ElementID, "", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
	}
	if (ElementType == "img") {
		fenster2=window.open("/edit/editimg.aspx?type=img&pageid="+PageID+"&ElementID="+ElementID+"&category="+Category, "", "toolbar=no,height=450,width=520,directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
	}
	if (ElementType == "standard") {
		fenster2=window.open("/edit/edit.aspx?type=standard&pageid="+PageID+"&ElementID="+ElementID, "", "toolbar=no,height=200,width=520,directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
	}
}

function editwindow(url) {
	msgWindow=window.open(url,"Edit","toolbar=no,width=520,height=450,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no")
}

function confirmwindow(url) {
if (confirm('Shure to delete this item?'))
	{
		msgWindow=window.open(url,"Edit","toolbar=no,width=520,height=450,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no")
	}
}

function OpenWin(newUrl){
			fenster2=window.open(newUrl, "", "toolbar=no,height=300,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function OpenWinS(newUrl, width, height){
			fenster2=window.open(newUrl, "", "toolbar=no,height="+height+",width="+width+",directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function editUserImg(ElementID){
		fenster2=window.open("editimage.aspx?type=img&ElementID="+ElementID, "", "toolbar=no,height=450,width=520,directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
}

function p_editUserImg(ElementID){
		fenster2=window.open("p-editimage.aspx?type=img&ElementID="+ElementID, "", "toolbar=no,height=450,width=520,directories=no,status=no,scrollbars=no,resizable=no,menubar=no");
}


function uploadUserImg(ElementID){
		fenster2=window.open("userimage1.aspx", "", "toolbar=no,height=450,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function p_uploadUserImg(ElementID){
		fenster2=window.open("p-userimage1.aspx", "", "toolbar=no,height=450,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function showmail(mailid){
		fenster2=window.open("showmail.aspx?id="+mailid,"", "toolbar=no,height=400,width=560,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function p_showmail(mailid){
		fenster2=window.open("p-showmail.aspx?id="+mailid,"", "toolbar=no,height=400,width=560,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}


function newmail(){
		fenster2=window.open("writemail2.aspx","", "toolbar=no,height=450,width=600,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function p_newmail(){
		fenster2=window.open("p-writemail2.aspx","", "toolbar=no,height=550,width=600,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function mailoptions(){
		fenster2=window.open("mailoptions.aspx","", "toolbar=no,height=450,width=600,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function mailrules(){
		fenster2=window.open("mailrules.aspx","", "toolbar=no,height=450,width=600,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function p_mailoptions(){
		fenster2=window.open("p-mailoptions.aspx","", "toolbar=no,height=450,width=600,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function newfolder(){
		fenster2=window.open("newmailfolder.aspx","", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function p_newfolder(){
		fenster2=window.open("p-newmailfolder.aspx","", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function deletefolder(boxid){
		fenster2=window.open("delmailfolder.aspx?boxid="+boxid,"", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function p_deletefolder(boxid){
		fenster2=window.open("p-delmailfolder.aspx?boxid="+boxid,"", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}


function addressbook(f){
		fenster2=window.open("selectmail.aspx?f="+f,"", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function p_addressbook(f){
		fenster2=window.open("p-selectmail.aspx?f="+f,"", "toolbar=no,height=400,width=720,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function p_mailinglist(f){
		fenster2=window.open("p-sendTmail.aspx?ac=mail&f="+f,"", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function newto(f){
		fenster2=window.open("editrecipient.aspx?f="+f,"", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function p_newto(f){
		fenster2=window.open("p-editrecipient.aspx?f="+f,"", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function editmail(mail,f){
		fenster2=window.open("editrecipient.aspx?mail="+mail+"&f="+f,"", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function p_editmail(mail,f){
		fenster2=window.open("p-editrecipient.aspx?mail="+mail+"&f="+f,"", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

// aspnetForm._ctl0_ContentPlaceHolder2_ //
function picaddress(mail,f){
	if (f==1) { 
		opener.Form1.tbTo.value = opener.Form1.tbTo.value + mail + ';'
	}
	if (f==2) {
		opener.Form1.tbCc.value = opener.Form1.tbCc.value + mail + ';'
	}
	opener.updateAddresses();
	opener.focus();
	self.close();
}

function p_picaddress(mail, f) {
    if (f==1) {
	    opener.document.getElementById('ctl00_ContentPlaceHolder2_tbTo').value = opener.document.getElementById('ctl00_ContentPlaceHolder2_tbTo').value + mail + '; '
	}
	if (f==2) {
	    opener.document.getElementById('ctl00_ContentPlaceHolder2_tbCc').value = opener.document.getElementById('ctl00_ContentPlaceHolder2_tbCc').value + mail + '; '
	}
	opener.updateAddresses();
	opener.focus();
	self.close();
}


function deleteaddress(mail,f){
	var regMail = new RegExp(mail+";");
	if (f==1) { 
		opener.Form1.tbTo.value = opener.Form1.tbTo.value.replace(regMail,"");
	}
	if (f==2) {
		opener.Form1.tbCc.value = opener.Form1.tbCc.value.replace(regMail,"");
	}
	opener.updateAddresses();
	opener.focus();
	self.close();
}

function p_deleteaddress(mail,f){
	var regMail = new RegExp(mail+";");
	if (f==1) { 
		opener.Form1.tbTo.value = opener.Form1.tbTo.value.replace(regMail,"");
	}
	if (f==2) {
		opener.Form1.tbCc.value = opener.Form1.tbCc.value.replace(regMail,"");
	}
	opener.updateAddresses();
	opener.focus();
	self.close();
}

function updateaddress(oldmail,newmail,f){
	var regOldMail = new RegExp(oldmail);
	if (f==1) { 
		opener.Form1.tbTo.value = opener.Form1.tbTo.value.replace(regOldMail, newmail);
	}
	if (f==2) {
		opener.Form1.tbCc.value = opener.Form1.tbCc.value.replace(regOldMail, newmail);
	}
	opener.updateAddresses();
	opener.focus();
	self.close();
}

function p_updateaddress(oldmail,newmail,f){
	var regOldMail = new RegExp(oldmail);
	if (f==1) { 
		opener.Form1.tbTo.value = opener.Form1.tbTo.value.replace(regOldMail, newmail);
	}
	if (f==2) {
		opener.Form1.tbCc.value = opener.Form1.tbCc.value.replace(regOldMail, newmail);
	}
	opener.updateAddresses();
	opener.focus();
	self.close();
}

function OpenPopUp(strID){
		fenster2=window.open("PopUp.aspx?reqID="+strID,"", "toolbar=no,height=350,width=350,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function p_OpenPopUp(strID){
		fenster2=window.open("p-PopUp.aspx?reqID="+strID,"", "toolbar=no,height=350,width=350,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function OpenNetiPopUp(strID){
		fenster3=window.open("../custom/netiquettePopUp.aspx","", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function p_OpenNetiPopUp(strID){
		fenster3=window.open("../custom/p-netiquette.aspx","", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}


function PromotionPopUp(strID){
		fenster2=window.open("promotionpopup.aspx?ID="+strID,"", "toolbar=no,height=350,width=350,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function p_PromotionPopUp(strID){
		fenster2=window.open("p-promotionpopup.aspx?ID="+strID,"", "toolbar=no,height=350,width=350,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function OpenDisclaimer(){
		fenster2=window.open("disclaimer.aspx","", "toolbar=no,height=400,width=450,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function contactdetails(strID){
		fenster2=window.open("contactdetailspop.aspx?reqID="+strID,"", "toolbar=no,height=380,width=590,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function p_contactdetails(strID) {
    fenster2 = window.open("contactdetailspop.aspx?reqID=" + strID, "", "toolbar=no,height=380,width=590,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function partymail(strPartyID){
		if(strPartyID>0)
			fenster2=window.open("PartyMail.aspx?reqID="+strPartyID+"&g=1","", "toolbar=no,height=400,width=640,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
		else
			fenster2=window.open("PartyMail.aspx?g=1","", "toolbar=no,height=400,width=640,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function p_partymail(strPartyID){
		if(strPartyID>0)
			fenster2=window.open("p-PartyMail.aspx?reqID="+strPartyID+"&g=1","", "toolbar=no,height=400,width=640,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
		else
			fenster2=window.open("p-PartyMail.aspx?g=1","", "toolbar=no,height=400,width=640,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}


function showhelp(PageName, ElementID){
	fenster2=window.open("../custom/help.aspx?&pagename="+PageName+"&ElementID="+ElementID+"#"+ElementID, "", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=yes,resizable=no,menubar=no");
}

function p_showhelp(PageName, ElementID){
	fenster2=window.open("/custom/p-help.aspx?&pagename="+PageName+"&ElementID="+ElementID+"#"+ElementID, "", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function o_showhelp(PageName, ElementID){
	fenster2=window.open("/custom/o-help.aspx?&pagename="+PageName+"&ElementID="+ElementID+"#"+ElementID, "", "toolbar=no,height=400,width=520,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
}

function feedback(){
	var popUp = null;
	actualPage = document.location.href; 
	nFparameter = "width=600,height=450,screenX=1,screenY=1,fullscreen=no,titlebar=yes,statusbar=no,location=no,scrollbars";
	popUp = window.open('/public/feedback.aspx?actualPage='+actualPage,'Feedback',nFparameter);
	popUp.focus();	
}

function p_feedback(){
	var popUp = null;
	actualPage = document.location.href; 
	nFparameter = "width=600,height=450,screenX=1,screenY=1,fullscreen=no,titlebar=yes,statusbar=no,location=no,scrollbars";
	popUp = window.open('/public/feedback.aspx?actualPage='+actualPage,'Feedback',nFparameter);
	popUp.focus();	
}

function checkDS()
{
	for (var i=0;i<document.aspnetForm.elements.length;i++)
    	{
		var e = document.aspnetForm.elements[i];
		if (e.name.substr(e.name.length-4,4) == 'cbDS'){
			e.checked = true;
			}
		}
}

function checkUM()
{
	for (var i=0;i<document.aspnetForm.elements.length;i++)
    	{
		var e = document.aspnetForm.elements[i];
		if (e.name.substr(e.name.length-4,4) == 'cbUM'){
			e.checked = true;
			}
		}
}

function checkSF()
{
	for (var i=0;i<document.aspnetForm.elements.length;i++)
    	{
		var e = document.aspnetForm.elements[i];
		if (e.name.substr(e.name.length-4,4) == 'cbSF'){
			e.checked = true;
			}
		}
}

/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/
var itemWidth = 250;
var itemHeight = 250;
var InlinePos = 0;
var offsetfrommouse=[15,15]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.
var currentimageheight = 270;	// maximum image size.
var noPicture = false;
function gettrailobj(){
if (document.getElementById)
return document.getElementById("trailimageid").style
else if (document.all)
return document.all.trailimagid.style
}
function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("trailimageid")
else if (document.all)
return document.all.trailimagid
}
function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function showtrail(imagename,title,description,showthumb,height, newItemWidth){
   if (newItemWidth != false) {
		itemWidth = newItemWidth;
	}
	if (height > 0){
		currentimageheight = height;
	}
	document.onmousemove=followmouse;
	cameraHTML = '';
	newHTML = ''//'<div>';
	//newHTML = newHTML + '<span>' + title + '</span><div class="borderbot"></div>';
	if (showthumb > 0){
		newHTML = newHTML + '<div style="border: 1px solid #000000;" align="center"><img src="' + imagename + '" border="0"></div>';
	}
	//newHTML = newHTML + '</div>';
gettrailobjnostyle().innerHTML = newHTML;
	gettrailobj().visibility="visible";
}

function showImage(imagename,title,description,showthumb,height, newItemWidth, newInlinePos){
   InlinePos = newInlinePos;
   if (newItemWidth != false) {
		itemWidth = newItemWidth;
	}
	if (height > 0){
		currentimageheight = height;
		itemHeight = height;
	}
	document.onmousemove=findmouse;
	cameraHTML = '';
	newHTML = ''//'<div>';
	if (showthumb > 0){
		newHTML = newHTML + '<div style="border: 1px solid #000000;" align="center"><img src="' + imagename + '" border="0"></div>';
	}
	//newHTML = newHTML + '</div>';
    gettrailobjnostyle().innerHTML = newHTML;
	gettrailobj().visibility="visible";
}

function showhtml(newHtml,height) {
	document.onmousemove=followmouse;
	newHtml = '<div style="border: 1px solid #000000;background-color:#FFFFFF;padding:5px" align="left">' + newHtml + '<div>';
	gettrailobjnostyle().innerHTML = newHtml;
	gettrailobj().visibility="visible";
}

function showhtmlhelp(newHtml,height) {
	document.onmousemove=followmouse;
	newHtml = '<div class="divInlineHelp">' + newHtml + '<div>';
	gettrailobjnostyle().innerHTML = newHtml;
	gettrailobj().visibility="visible";
}

function hidetrail(){
	gettrailobj().visibility="hidden"
	document.onmousemove=""
	gettrailobj().left="-1000px"
	gettrailobj().top="-1000px"
}
function followmouse(e){
	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]
	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(document.body.offsetHeight, window.innerHeight)
	if (typeof e != "undefined"){
		if (docwidth - e.pageX < itemWidth + 50){
			if (noPicture == "yes") {
				xcoord = e.pageX - xcoord - itemWidth; // Move to the left side of the cursor
			} else {
				xcoord = e.pageX - xcoord - itemWidth; // Move to the left side of the cursor
			}
		} else {
			xcoord += e.pageX;
		}
		if ((docheight - e.pageY) < (currentimageheight )){
			ycoord += e.pageY - Math.max(0,(0 + currentimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY ;
		}
	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < itemWidth + 50){
			if (noPicture == "yes") {
				xcoord = event.clientX + truebody().scrollLeft - xcoord - itemWidth; // Move to the left side of the cursor
			} else {
				xcoord = event.clientX + truebody().scrollLeft - xcoord - itemWidth; // Move to the left side of the cursor
			}
		} else {
			xcoord += truebody().scrollLeft+event.clientX 
		}
		if (docheight - event.clientY < (currentimageheight )){
	        //ycoord += event.clientY + truebody().scrollTop - Math.max(0,(0 + currentimageheight + event.clientY - docheight));
	        ycoord += truebody().scrollTop + event.clientY;
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}
	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"
}

function findmouse(e){
	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]
	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(document.body.offsetHeight, window.innerHeight)
	if (typeof e != "undefined"){
		if (InlinePos > 2){
			if (noPicture == "yes") {
				xcoord = e.pageX - xcoord - itemWidth; // Move to the left side of the cursor
			} else {
				xcoord = e.pageX - xcoord - itemWidth; // Move to the left side of the cursor
			}
		} else {
			xcoord += e.pageX;
		}
			ycoord += e.pageY + ycoord;
	} else if (typeof window.event != "undefined"){
		if (InlinePos > 2){
			if (noPicture == "yes") {
				xcoord = event.clientX + truebody().scrollLeft - xcoord - itemWidth; // Move to the left side of the cursor
			} else {
				xcoord = event.clientX + truebody().scrollLeft - xcoord - itemWidth; // Move to the left side of the cursor
			}
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
			ycoord += truebody().scrollTop + event.clientY + ycoord;
	}
	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"
	document.onmousemove="";
}

function HandleRequestStart(comboBox, text, more)
{
    if (text.length==0){return true;}
    if (text.length<3){return false;}
}

