function assignNews(slot,articleID)
{
	changeLog.value+=makeUpdateString("tcom_newsSlots","articleID",slot,articleID)
	redirectURL.value="index.aspx?page=cms&cms=15"
	btnSubmit.click()	
}
function endAccount()
{
	if(prompt('Wollen Sie ihre Mitgliedschaft wirklich beenden, dann tippen Sie nun ja ein.','Nein')=='ja'){window.location='index.aspx?page=1&terminateAccount=1'}
}
function addFileAss(pageID,dFileName)
{
	changeLog.value+=makeInsertString("tcom_pagesDocuments","pageID,documentFileName",pageID+"','"+dFileName)
	btnSubmit.click()
}
function addHR(pageID)
{
	changeLog.value+=makeInsertString("tcom_articles","pageID,templateID,designation",pageID+"','99','Trennlinie")
	btnSubmit.click()
}
function addDoubleColumnBatch(pageID)
{
	changeLog.value+=makeInsertString("tcom_articles","pageID,templateID,designation",pageID+"','24','Zweispaltig: Linke Spalte ab hier")
	changeLog.value+=makeInsertString("tcom_articles","pageID,templateID,designation",pageID+"','25','Zweispaltig: Rechte Spalte ab hier")
	changeLog.value+=makeInsertString("tcom_articles","pageID,templateID,designation",pageID+"','26','Zweispaltig: Ende")
	btnSubmit.click()
}
function newSubLink(linkID,menuID)
{
	changeLog.value+=makeInsertString("tcom_menuLinks","menuID,ChildOf",menuID+"','"+linkID)
	btnSubmit.click()	
}
function addExistingTeaser(pageID,columnID)
{
	changeLog.value+=makeInsertString("tcom_teasersPages", "pageID,columnID",pageID+"','"+columnID)
	btnSubmit.click()	
}
function generateHyperlink(txt,lnk,nw)
{
	return("<a href='" + lnk + "'"+nw+ ">" + txt + "</a>")	
}
var lastRcmc
var rcmcDisplayed = false
function categoryContext(rcmc)
{
	if(!rcmcDisplayed)
	{
		showContext(rcmc)
	}
	else
	{
		hideContext()
	}
}
function showContext(rcmc)
{
	var popUpMenu = document.getElementById('rightClickMenu'+rcmc)
	popUpMenu.style.visibility='visible'
	popUpMenu.style.top = event.clientY + document.body.scrollTop -5
	popUpMenu.style.left = event.clientX + document.body.scrollLeft-5
	rcmcDisplayed = true
	lastRcmc=rcmc
	return(false)	
}
function hideContext()
{
	var popUpMenu = document.getElementById('rightClickMenu'+lastRcmc)
	rcmcDisplayed = false
	popUpMenu.style.visibility='hidden'
}
function promoteCategory(aid,promoteTo)
{
	changeLog.value+=makeUpdateString("tcom_categories","chilfOf",aid,promoteTo)	
	btnSubmit.click()
}
function forum_setCode() 
{
         if (document.selection && document.selection.createRange().text != '') document.selection.createRange().text = '[code]'+document.selection.createRange().text+'[/code]';
}
function forum_setItalic() 
{
         if (document.selection && document.selection.createRange().text != '') document.selection.createRange().text = '[i]'+document.selection.createRange().text+'[/i]';
}
function forum_setBold() 
{
         if (document.selection && document.selection.createRange().text != '') document.selection.createRange().text = '[b]'+document.selection.createRange().text+'[/b]';
}
function forum_makeLink()
{
	if (document.selection && document.selection.createRange().text != '') 
		{
			var hrf = window.showModalDialog('makeLink.html','','dialogHeight: 100px; dialogWidth: 400px; dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; help: No; resizable: No; status: No;')
			if(hrf!='')
			{
				document.selection.createRange().text = '[link:'+hrf+']'+document.selection.createRange().text+'[/link]';
			}
		}
}
function openPopup(url)
{
	var popup = window.open(url,"Popup","left=200,top=15,resizable=yes,width=500,height=500")
}

function check_uploadZip(value){
	regex = /[zip]$/i;
	result = regex.test(value);
	if(result == 0){
		alert("Die Datei muss ein Zip-Archiv sein!");
	}
}

function setCookie(c_name,value,expiredays)
{var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}

function checkAnchor()
{
 
    var url = document.location;
    var strippedUrl = url.toString().split('#');
    if (strippedUrl.length > 1) {
       setCookie('aVal',strippedUrl[1],1);
       }
    aVal = getCookie('aVal')
    if (aVal!=null && aVal!="")
    {
       window.location.hash = aVal;
    }



}

