function post_values(formname){
	eval("document."+formname+".submit()");
}

function reset_values(formname){
	eval("document."+formname+".reset()");
}

function change_image(id,image){
	document.getElementById(id).setAttribute("src",image);
}

function delete_check(){
	var x = window.confirm("Sind Sie sicher, dass Sie dieses löschen möchten?");
	return x;
}

function open_image(imagename,title,width,height){
	var newwin = window.open("popup.php?imagename="+imagename+"&title="+title+"&width="+width+"&height="+height,"gallerie_popup","width="+(width+10)+",height="+(height+10)+",left=0,top=0,scrollbars=no,status=no,toolbar=no,menubar=no,resizable=no");
  newwin.focus();
}

function change_class(id,classname){
	document.getElementById(id).className = classname;
}

function open_popup(filename,width,height){
	var newwin = window.open(filename,"popup","width="+width+",height="+height+",left=0,top=0,scrollbars=no,status=no,toolbar=no,menubar=no,resizable=no");
  newwin.focus();
}

function open_popup_zentral(filename,width,height){
	var newwin = window.open(filename + "?get_zentral_navigation_id=1","popup","width="+width+",height="+height+",left=0,top=0,scrollbars=no,status=no,toolbar=no,menubar=no,resizable=no");
  newwin.focus();
}

function open_presse_details(presse_id, datum){
	var newwin = window.open('popup.php?get_presse_id='+presse_id+'&datum='+datum,'live','scrollbars=yes,width=580,height=460');
}

function open_presse_details_zentral(presse_id, datum){
	var newwin = window.open('popup.php?get_presse_id='+presse_id+'&get_zentral_navigation_id=1','live','scrollbars=yes,width=580,height=460');
}

function select_link_target(formname,internal_id,news_id,external_id,mail_id,popup_id,product_id,external_links,internal_links,news_links,product_links,external_field,internal_field,news_field,product_field){
	document.getElementById(external_links).style.display="none";
	document.getElementById(internal_links).style.display="none";
	document.getElementById(news_links).style.display="none";
	document.getElementById(product_links).style.display="none";
	document.getElementById(external_field).name="";
	document.getElementById(internal_field).name="";
	document.getElementById(news_field).name="";
	document.getElementById(product_field).name="";
	if(eval("document."+formname).post_info_update_links_id.value==internal_id){
		document.getElementById(internal_links).style.display="block";
		document.getElementById(internal_field).name="post_info_update_link";
	}
	if(eval("document."+formname).post_info_update_links_id.value==external_id || eval("document."+formname).post_info_update_links_id.value==mail_id || eval("document."+formname).post_info_update_links_id.value==popup_id){
		document.getElementById(external_links).style.display="block";
		document.getElementById(external_field).name="post_info_update_link";
	}
	if(eval("document."+formname).post_info_update_links_id.value==news_id){
		document.getElementById(news_links).style.display="block";
		document.getElementById(news_field).name="post_info_update_link";
	}
	if(eval("document."+formname).post_info_update_links_id.value==product_id){
		document.getElementById(product_links).style.display="block";
		document.getElementById(product_field).name="post_info_update_link";
	}
}

function select_link_target2(formname,internal_id,news_id,external_id,mail_id,popup_id,product_id,external_links,internal_links,news_links,product_links,external_field,internal_field,news_field,product_field){
	document.getElementById(external_links).style.display="none";
	document.getElementById(internal_links).style.display="none";
	document.getElementById(news_links).style.display="none";
	document.getElementById(product_links).style.display="none";
	document.getElementById(external_field).name="";
	document.getElementById(internal_field).name="";
	document.getElementById(news_field).name="";
	document.getElementById(product_field).name="";
	if(eval("document."+formname).post_text_update_links_id.value==internal_id){
		document.getElementById(internal_links).style.display="block";
		document.getElementById(internal_field).name="post_text_update_link";
	}
	if(eval("document."+formname).post_text_update_links_id.value==external_id || eval("document."+formname).post_text_update_links_id.value==mail_id || eval("document."+formname).post_text_update_links_id.value==popup_id){
		document.getElementById(external_links).style.display="block";
		document.getElementById(external_field).name="post_text_update_link";
	}
	if(eval("document."+formname).post_text_update_links_id.value==news_id){
		document.getElementById(news_links).style.display="block";
		document.getElementById(news_field).name="post_text_update_link";
	}
	if(eval("document."+formname).post_text_update_links_id.value==product_id){
		document.getElementById(product_links).style.display="block";
		document.getElementById(product_field).name="post_text_update_link";
	}
}

function check_if_presse(){
	document.getElementById('presse_order').style.display="none";
	if(document.update_navigation.post_navigation_update_templates_id.value==30){
		document.getElementById('presse_order').style.display="block";
	}
}

function check_browser(){
	var browserName=navigator.appName;
	if (browserName!="Microsoft Internet Explorer"){
	 	document.getElementById('white_line').style.display="none";
	}
}