function openStarWin(real_link,starValue,salesPartner,is_language) {
	starWin = window.open(real_link+"starinfo.php?salesPartner="+salesPartner+"&setLanguage="+is_language+"&starValue="+starValue,"starWin","width=300,height=200,left=100,top=100,resizable=yes,scrollbars=auto");
	starWin.focus();
}

/*---------------- Leitet von .com nach .de weiter -----------------------------------------------------------------------------------*/

function COMtoDE(hostlink, is_language, salesPartner) {
	// alert(is_language+", "+salesPartner);
	setTimeout(window.location.href=hostlink+"index.php?setLanguage="+is_language+"&salesPartner="+salesPartner,0);
}

/*----------------openPartnerWindow-----------------------------------------------------------------------------------*/

function openPartnerWindow(hostLink,name_ID,salesPartner,is_language) {
	// F1 = window.open("http://www.shoplooker.de/partner.php?ID="+name_ID+"&salesPartner="+salesPartner+"&setLanguage="+is_language,"Fenster1","width=600,height=500,left=0,top=0,resizable=yes,scrollbars=yes");
	F1 = window.open(hostLink+"partner.php?ID="+name_ID+"&salesPartner="+salesPartner+"&setLanguage="+is_language,"Fenster1","width=600,height=500,left=0,top=0,resizable=yes,scrollbars=yes");
}

/*----------------openAlleNewsWindow-----------------------------------------------------------------------------------*/

function openNewsWindow(real_link,salesPartner,is_language) {
	newsWin = window.open(real_link+"allNews.php?salesPartner="+salesPartner+"&setLanguage="+is_language,"newsWin","width=400,height=500,left=0,top=0,resizable=yes,scrollbars=yes");
}

/*----------------menu-----------------------------------------------------------------------------------*/



/*----------------showPopup-----------------------------------------------------------------------------------*/

function loadAndPop(hostLink,bannerID) {
	var pixelToRight = screen.width-600;
	// alert(bannerID);
	
	adPopup = window.open(hostLink+"werbung/werbepopup.php?bannerID="+bannerID,"adWindow","width=468,height=60,left="+pixelToRight+",top=10,resizable=yes,scrollbars=no,status=no");
	adPopup.focus();
}
/*----------------menu-----------------------------------------------------------------------------------*/

function setCat(cat,navi,table)
{
	// alert(cat+" "+navi);
	window.location.href = ("affili_new.php?navi_ID="+navi+"&table="+table+"&setCat="+cat);
}


function selectSearchValue(selectOption,email,user,ID,pw,cmd,formname)
{
	show = 'ja';
	// alert(selectOption+", "+email+", "+user+", "+ID+", "+pw+", "+cmd+", "+formname);
	
	window.location.href = ("index.php?email="+email+"&user="+user+"&ID="+ID+"&d="+pw+"&cmd="+cmd+"&col_name="+formname+"&col_value="+selectOption);
}
/*----------------openHelpWindow-----------------------------------------------------------------------------------*/

function openHelpWindow(ID,language) {
	// alert(ID+" "+language);
	F3 = window.open("help.php?helpID="+ID+"&setLanguage="+language,"Help","width=600,height=450,left=0,top=0,resizable=yes,scrollbars=yes");
	F3.focus();
}

/*----------------open_bill-----------------------------------------------------------------------------------*/

function open_bill(number) {
	// alert(number);
	F4 = window.open(number+".html","Billing","width=625,height=450,left=0,top=0,resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes");
	F4.focus();
}

/*----------------open_download-----------------------------------------------------------------------------------*/

function open_download(link) {
	alert(link);
	F5 = window.open(link,"Billing","width=200,height=100,left=0,top=0,resizable=no,scrollbars=no,menubar=no,toolbar=no");
	F5.focus();
}

/*----------------Offerer----------------------------------------------------------------------------------*/

function showSelectedOfferer(getLink)
{
	// alert(offerer_id+" "+language);
	if(getLink != 'x') {
		window.location.href = getLink;
	}
}

/*----------------Offerer----------------------------------------------------------------------------------*/

function showSelectedCat(catLink)
{
	// alert(offerer_id+" "+language);
	if(catLink != 'x') {
		window.location.href = (catLink);
	}
}

/*----------------CatSearch----------------------------------------------------------------------------------*/

function showSearchCat(SearchCatLink)
{
	// alert(SearchCatLink);
	if(SearchCatLink != 'x') {
		window.location.href = (SearchCatLink);
	}
}

/*----------------Offerer----------------------------------------------------------------------------------*/

function openShowBar(thisPartner,thisLocalFile,std_path)
{
	anzeige = window.open("showBar.php?thisPartner="+thisPartner+"&thisLocalFile="+thisLocalFile+"&std_path="+std_path,"anzeige","width=300,height=210,left=0,top=0");
	anzeige.focus();
}

/* Alles für das Helferlein */

N = (document.all) ? 0 : 1;
var ob;
var over = false;



function MD(e) {
	if (over) {
		if (N) {
			ob = document.getElementById("panel");
			X=e.layerX;
			Y=e.layerY;
			return false;
		} else {
			ob = document.getElementById("panel");
			ob = ob.style;
			X=event.offsetX;
			Y=event.offsetY;
		}
	}
}



function MM(e) {
	if (ob) {
		if (N) {
			ob.style.top = e.pageY-Y;
			ob.style.left = e.pageX-X;
		} else {
			ob.pixelLeft = event.clientX-X + document.body.scrollLeft;
			ob.pixelTop = event.clientY-Y + document.body.scrollTop;
			return false;
		}
	}
}



function MU() {
	ob = null;
}

if (N) {
	document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);
}

document.onmousedown = MD;
document.onmousemove = MM;
document.onmouseup = MU;

function EinAus(schalter) {
	if(schalter == "aus") {
		document.getElementById("panel").style.visibility = "hidden"; return;
	}
   	if(schalter == "an") {
   		document.getElementById("panel").style.visibility = "visible"; return;
   	}
}

var link = new Array();
link[0] = "Startseite|http://www.shoplooker.com|java24.net - Homepage";
link[1] = ". Newsletter|http://www.newsletter.java24.net|java24.net - Newsletter";
link[2] = ". eMail bei Java24.net|http://www.webmail.java24.net|Deine eMail bei Java24.net";
link[3] = ". News|http://www.news.java24.net|java24.net - News";
link[4] = ". ebay - java24.net|http://www.ebay.java24.net|ebay - java24.net";
link[5] = "Keine Hilfe|javascript:EinAus(\"aus\")|Das Newsletterarchiv";

function getArray(id) {
	var splitarray = link[id].split("|");
	return splitarray;
}

function info(i,obj) {
	sublink = getArray(i);
	infobar = document.getElementById("infob");
	infobar.innerHTML = "&nbsp;"+sublink[2];
	// obj.style.backgroundColor=col;
}

function endi(obj) {
	// obj.style.backgroundColor=col;
	infobar = document.getElementById("infob");
	infobar.innerHTML = "&nbsp;<br>";
}

/*----------------Show disbursement files----------------------------------------------------------------------------------*/

function showSelectedFile(getLink)
{
	// alert(offerer_id+" "+language);
	if(getLink != '') {
		window.location.href = getLink;
	}
}

//----------------------------------------------------------------------------------------

function setAffiliTyp(getAffiliTyp) {
	document.admin_select.typ.value = getAffiliTyp;
}

function setContentBreak(getContentBreak) {
	document.admin_select.contentBreak.value = getContentBreak;
}

function setSub(getSubject) {
	if(getSubject == "x") {
		document.forms[1].emailSubject.value = document.forms[1].emailSubject.value;
		document.forms[1].emailSubject.focus();
	} else {
		document.forms[1].emailSubject.value += getSubject;
		document.forms[1].emailSubject.focus();
	}
}

//--------------------------------------------
// formatierte Texte mit UBB-Code
//--------------------------------------------

function setPlaceHolder(code) {
	document.forms[1].beschreibung.value += "{"+code+"}";
	document.forms[1].beschreibung.focus();
}

function setcode(code,prompttext,question) {
	if(code == "br") {
		document.forms[1].beschreibung.value += "["+code+"]";
	} else if(code == "p") {
		aligntxt = "left";
		align = prompt(question+"\n",aligntxt);
		document.forms[1].beschreibung.value += "["+code+" align='"+align+"']";
	} else {
	inserttext = prompt(question+"\n",prompttext);
		if ((inserttext != null) && (inserttext != "")) {
			document.forms[1].beschreibung.value += "["+code+"]"+inserttext+"[/"+code+"]";
		}
	}
	document.forms[1].beschreibung.focus();
}

function setline(code,width,color,questionWIDTH,questionCOLOR,questionALIGN) {
	width = "100";
	color = "#";
	align = "center";
	
	width = prompt(questionWIDTH+"\n",width);
	color = prompt(questionCOLOR+"\n",color);	
	align = prompt(questionALIGN+"\n",align);
	
	if ((width != null) && (width != "") && (color != null) && (color != "") && (color != "#") && (align != null) && (align != "")) {
		document.forms[1].beschreibung.value += "["+code+" align='"+align+"' width='"+width+"%' color='"+color+"']";
	} else {
		document.forms[1].beschreibung.value += "["+code+" align='center' width='100%' color='#000000']";
	}
	document.forms[1].beschreibung.focus();
}

function seturl(type,questionDESC,questionURL,questionMAILTO,questionTARGET) {
	description = prompt(questionDESC+"\n","");
	if (type == "URL") {
		text = questionURL;
		content = "http://";
		}
	else {
		text = questionMAILTO;
		content = "";
		}
	url = prompt(text,content);
	if ((url != null) && (url != "")) {
		if ((description != null) && (description != "")) {
			if (type == "URL") {
				target_text = questionTARGET;
				target_content = "_blank";
				target = prompt(target_text,target_content);
				document.forms[1].beschreibung.value += "[a href="+url+" target='"+target+"']"+description+"[/a]";
			} else {
				document.forms[1].beschreibung.value += "[a href=mailto:"+url+"]"+description+"[/a]";
			}
		} else {
			if (type == "URL") {
				target_text = questionTARGET;
				target_content = "_blank";
				target = prompt(target_text,target_content);
				document.forms[1].beschreibung.value += "[a href="+url+" target='"+target+"']"+url+"[/a]";
			} else {
				document.forms[1].beschreibung.value += "[a href=mailto:"+url+"]"+url+"[/a]";
			}
		}
	}
	document.forms[1].beschreibung.focus();
}


function setimgurl(type1,type2,questionURL,questionCLICKURL,questionDESC,questionTARGET) {
	pic_text = questionURL;
	pic_content = "http://";
	picurl = prompt(pic_text,pic_content);
	
	link_text = questionCLICKURL;
	link_content = "http://";
	url = prompt(link_text,link_content);

	title = questionDESC;
	title_content = "";
	alt = prompt(title,title_content);

	if ((picurl != null) && (picurl != "")) {
		if ((url != null) && (url != "http://") && (url != "")) {
			target_text = questionTARGET;
			target_content = "_blank";
			target = prompt(target_text,target_content);
			document.forms[1].beschreibung.value += "[a href='"+url+"' target='"+target+"'][img src='"+picurl+"' border='0' alt='"+alt+"' title='"+alt+"'][/a]";
		} else {
			document.forms[1].beschreibung.value += "[img src='"+picurl+"' border='0' alt='"+alt+"' title='"+alt+"']";
		}
		document.forms[1].beschreibung.focus();	
	}
}

//----------------------------------------------------------------------------------------

function checkGoToTarget(confirmTXT,getLink,spTXT,delTyp) {
	Check = confirm(confirmTXT);
	
	if(Check == true) {
		if(delTyp == "user") {
			AskSP = prompt(spTXT,"");
			if((AskSP != null) && (AskSP != "")) {
				window.location.href = getLink+"&setProviToSP="+AskSP;
			}
		} else {
			window.location.href = getLink;
		}
	}
}
