var menuwidth='100px' //default menu width
var menubgcolor='#ffffff'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+';" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')


function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}
if (hidemenu_onclick=="yes")
document.onclick=hidemenu

function close_Div_success()	 
{
		document.getElementById('success_popup').style.display='none';
		document.getElementById('general_mainDIV').style.display= 'none';
		window.location.href= pageRedirect;
}
function finish_paper()
{
	window.location.href = baseUrl+'home';
}
function finish_starter()
{
	window.location.href= baseUrl+'home';
}
function show_forgotpass()
{
	loadVeil_fpass();
	$('#popup_forgot_pass').load(baseUrl+"home/show_forgetpass/");
	var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
	width_t=width/2;
	wid_pop=820/2;
	wid=width_t-wid_pop;
	var top = 140;
	$('#popup_forgot_pass').css('left',wid+'px');
	$('#popup_forgot_pass').css('top',top+'px');
	$('#popup_forgot_pass').css('display','block');
	
}
function loadVeil_fpass()
{
	$('#mainDIV_forgot_pass').css('opacity','0.3');
	$('#mainDIV_forgot_pass').css('height',$(window).height()+'px');
	$('#mainDIV_forgot_pass').css('display','block');
}
function closeDivForgot()
{
	$('#popup_forgot_pass').hide();
	$('#mainDIV_forgot_pass').hide();
}	 
function call_forgetpass()
{
	$('#popup_forgot_pass').show();
	// wait for the DOM to be loaded 
	$('#forgetpass').ajaxSubmit({target:'#popup_forgot_pass',complete:function(request){
			
			if (request.responseText == 'success') {
				 // forgot pass email sent successfully
				 closeDivForgot();				
			}
		}
	}); 
	$('#forgetpass').html('<div align="center"><img src ="'+baseUrl+'images/waitingImage.gif" /></div>');
	return false;
}
function call_addEmail()
	 {
		$('#newsletter_frm').ajaxSubmit({target:'',complete:function(request){
					 if(request.responseText == 'alereadyExist') {
					    show_general_error_popup(baseUrl+'images/frontend/'+frontLang+'/hl_heldennews.gif','<strong>'+newsletterErrorAlreadyExistHeading+'.</strong>',newsletterErrorAlreadyExistText);                  
						return false;
					 } else if(request.responseText == 'FAILED') {
					    show_general_error_popup(baseUrl+'images/frontend/'+frontLang+'/fehlerhafter-e-mail.gif','<strong>'+newsletterErrorPopupHeading+'.</strong>',newsletterErrorPopupText);                  
						return false;
					 } else if(request.responseText == 'SUCCESS') {
					    document.getElementById('newsletter_email').value='';						
						show_general_error_popup(baseUrl+'images/frontend/'+frontLang+'/registrierung.gif','<strong>'+newsletterSuccessPopupHeading+'</strong>',newsletterSuccessPopupText);
					 }
				}
			}
		);
		
}
function call_changepass()
{
	$('#popup_change_pass').show();
	// wait for the DOM to be loaded 
	$('#changepass').ajaxSubmit({target:'#popup_change_pass',complete:function(request){
			if (request.responseText == 'complete')
			 {
				$('#popup_change_pass').css('display','none');
				$('#mainDIV_change_pass').css('display','none');
				window.location.href= baseUrl+'contactinfo/index';
			 }
		}
	});
	return false;
}
function show_edit_info()
{	
	$('#popup_edit_info').html('');
	loadVeil_edit_info();
	$('#popup_edit_info').load(baseUrl+"contactinfo/show_editinfo/");
	var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
	width_t=width/2;
	wid_pop=820/2;
	wid=width_t-wid_pop;
	var top = 140;
	$('#popup_edit_info').css('left',wid+'px');
	$('#popup_edit_info').css('top',top+'px');
	$('#popup_edit_info').css('display','block');
}
function call_editinfo()
{
	if(window.confirm(confirmation)){
	$('#popup_edit_info').show();
	// wait for the DOM to be loaded 
	$('#editinfo').ajaxSubmit({target:'#popup_edit_info',complete:function(request){
	     var str = request.responseText;
		     done = str.substring(0,4)
			str= str.substring(4);
			 if (done == 'done')
			 {
				document.getElementById('my_account').innerHTML=str;
				document.getElementById('login_name_div').innerHTML=str.substring(str.search('<p>')+3,str.search('</p>'));
				$('#popup_edit_info').css('display','none');
				$('#mainDIV_edit_info').css('display','none');
			 }
		}
	});
	}
	return false;
}
function delBankInfo()
{
	if(window.confirm(confirmation)){
	    document.location.href=baseUrl+'contactinfo/delBank';
	}
	return false;
}
function changeCountry(countryId)
{
  window.location = baseUrl+'change_country/index/'+countryId;
}
function show_edit_bank_info()
{	
	$('#popup_edit_bank_info').html('');
	loadVeil_edit_bank_info();
	$('#popup_edit_bank_info').load(baseUrl+"contactinfo/show_editbankinfo/");
	var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
	width_t=width/2;
	wid_pop=820/2;
	wid=width_t-wid_pop;
	var top =140;
	$('#popup_edit_bank_info').css('left',wid+'px');
	$('#popup_edit_bank_info').css('top',top+'px');
	$('#popup_edit_bank_info').css('display','block');
}	
function redirectToPage(url) {
	window.location = url;
}
function show_new_address_info()
{	
	$('#new_address_popup').html('');
	loadVeil_new_address_info();
	$('#new_address_popup').load(baseUrl+"addressbook/show_newaddressinfo/");
	var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
	width_t=width/2;
	wid_pop=820/2;
	wid=width_t-wid_pop;
	var top = 140;
	$('#new_address_popup').css('left',wid+'px');
	$('#new_address_popup').css('top',top+'px');
	$('#new_address_popup').css('display','block');
}
function changecountrycode(field,frm){
	document.forms.frm.ustid.value='';
	num = field.selectedIndex;
	var selectedId = 0;
	if(num != 0)
		var selectedId = document.forms.frm.countrycodelist.options[num-1].value;
	if(frm == 'frm') {
		if(num != 0)
			wert = document.forms.frm.countrycodelist.options[num-1].text;
		else
			wert = '';
		document.forms.frm.countrycode.value=wert;
	} else {
		wert = document.forms.frmhaben.countrycodelist.options[num-1].text;
		document.forms.frmhaben.countrycode.value=wert;
	}
	if(num == 0 || num == 1 || selectedId == 241) {
		document.getElementById('e2').style.display='none';
	} else if(num>1) {
	  	document.getElementById('e2').style.display='block';
	}
	
}
function changesitelanguages(val){
	var url = baseUrl+'registration/siteLanguages/'+val;
	var curl = baseUrl+'registration/siteLanguagesCount/'+val;
	var uurl = baseUrl+'registration/registerFirst';
	count = 0;
	//alert(curl);
	$('#site_langs').html('');
	$('#site_langs').load(baseUrl+'registration/updateLanguages/'+val);
}
function show_first_time_change_pass()
{	
	$('#popup_change_pass').show();
	loadVeil_first_time_change_pass();
	$('#popup_change_pass').load(baseUrl+"home/show_first_time_changepass/");
	var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
	width_t=width/2;
	wid_pop=820/2;
	wid=width_t-wid_pop;
	var top = 140;
	$('#popup_change_pass').css('left',wid+'px');
	$('#popup_change_pass').css('top',top+'px');
	$('#popup_change_pass').css('display','block');
}
function call_first_time_changepass()
{
	$('#popup_change_pass').show();
	// wait for the DOM to be loaded 
	$('#firsttimechangepass').ajaxSubmit({target:'#popup_change_pass',complete:function(request){
			if (request.responseText == 'complete')
			 {
				$('#popup_change_pass').css('display','none');
				$('#mainDIV_change_pass').css('display','none');
				window.location.href= baseUrl+'home';
			 }
		}
	});
	return false;
}
function changecountrycodecontact(field,frm){
	num = field.selectedIndex;
	wert = document.forms.frmhaben.countrycodelist.options[num-1].text;
	document.forms.frmhaben.countrycode.value=wert;
	if(num==1)
	{
	  document.getElementById('e2').style.display='none';
	}else if(num>1)
	{
	  document.getElementById('e2').style.display='block';
	}
}

function call_newaddressinfo()
{
	document.getElementById('new_address_popup').style.display = 'block';
	// wait for the DOM to be loaded 
	$('#newaddressinfo').ajaxSubmit({target:'#new_address_popup',complete:function(request){
			if (request.responseText == 'sucess')
			 {
				$('#new_address_popup').css('display','none');
				$('#mainDIV_new_address_info').css('display','none');
				window.location.href= baseUrl+'addressbook/index';
			 }
		}
	});
	return false;
}
function show_edit_address_info() {	
	$('#edit_address_popup').html('');
	loadVeil_edit_address_info();
	$('#edit_address_popup').load(baseUrl+"addressbook/show_editaddressinfo/");
	var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
	width_t=width/2;
	wid_pop=820/2;
	wid=width_t-wid_pop;
	var top = 140;
	$('#edit_address_popup').css('left',wid+'px');
	$('#edit_address_popup').css('top',top+'px');
	$('#edit_address_popup').css('display','block');
}
function show_edit_other_address_info(add_id)
{	
	$('#edit_other_address_popup').html('');
	loadVeil_edit_other_address_info();
	$('#edit_other_address_popup').load(baseUrl+"addressbook/show_editotheraddressinfo/"+add_id);
	var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
	width_t=width/2;
	wid_pop=820/2;
	wid=width_t-wid_pop;
	var top = 140;
	$('#edit_other_address_popup').css('left',wid+'px');
	$('#edit_other_address_popup').css('top',top+'px');
	$('#edit_other_address_popup').css('display','block');
}
function call_editotheraddressinfo()
{
	$('#edit_other_address_popup').show();
	// wait for the DOM to be loaded 
	$('#editotheraddressinfo').ajaxSubmit({target:'#edit_other_address_popup',complete:function(request){
			if (request.responseText == 'success')
			 {
				$('#edit_other_address_popup').css('display','none');
				$('#mainDIV_edit_other_address_info').css('display','none');
				window.location.href= baseUrl+'addressbook/index';
			 }
		}
	});
	return false;
}
function delete_customer_address(address_id)
{
	var url = baseUrl+'addressbook/delete_user_address/'+address_id;
	jQuery.post(url, function() {
						$('#cust_address_'+address_id).remove();
					}
	);
	//window.location.href= url;
}
function change_default(address_id)
{
	var url = baseUrl+'addressbook/change_default_user/'+address_id;
	window.location.href= url;		
}
function show_new_order_address(type)
{	
	document.getElementById('new_adress_popup').innerHTML = '';
	loadVeil_order_new_address();
	$('#new_adress_popup').load(baseUrl+"order/show_newaddressinfo/"+type);
	var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
	width_t=width/2;
	wid_pop=820/2;
	wid=width_t-wid_pop;
	var top = 140;
	$('#new_adress_popup').css('left',wid+'px');
	$('#new_adress_popup').css('top',top+'px');
	$('#new_adress_popup').css('display','block');
}
function call_order_newaddress(id)
{
	document.getElementById('new_adress_popup').style.display = 'block';
	// wait for the DOM to be loaded 
	$('#newaddressinfo').ajaxSubmit({target:'#new_adress_popup',complete:function(request){
			if (request.responseText == 'sucess')
			 {
				$('#new_adress_popup').css('display','none');
				$('#mainDIV_new_address').css('display','none');
				window.location.href= baseUrl+'order/address_book/'+id;
			 }
		}
	});
	return false;
}
function showLoginFrm() {
	$('#login_popup').html('');
	loadVeil_login();
	$('#login_popup').load(baseUrl+"cart/show_popup_login/");
	var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
	width_t=width/2;
	wid_pop=820/2;
	wid=width_t-wid_pop;
	var top = 140;
	$('#login_popup').css('left',wid+'px');
	$('#login_popup').css('top',top+'px');
	$('#login_popup').css('display','block');
}
function checkOut(url) {
	if(document.getElementById('crt_frm') != null)
		$('#crt_frm').submit();
	else
		window.location = url;
}
//		generic funtions for error popup					//
function loadGeneralVeil() {
	$('#general_mainDIV').css('opacity','0.3');
	$('#general_mainDIV').css('display','block');
	if(jQuery.browser.safari )
		height = $(window).height() + $(document).height()/3 +'px';
	else if(jQuery.browser.msie || jQuery.browser.version == '6.0')
		height = $(window).height() + $(document).height()/60 +'px';
	else
		height = $(window).height() + $(document).height() +'px';
	$('#general_mainDIV').css('height',height);
		
}
function close_general_Div() {
	$('#general_mainDIV').css('display','none');
	$('#general_error_popup').css('display','none');
}
function ajaxdiv_success()
	{
		loadVeil_success();
		var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
		width_t=width/2;
		wid_pop=820/2;
		wid=width_t-wid_pop;
		var top = 140;
		$('#success_popup').css('left',wid+'px');
		$('#success_popup').css('top',top+'px');
		$('#success_popup').css('display','block');
	}
function loadVeil_success() {
	$('#general_mainDIV').css('opacity','0.3');
	$('#general_mainDIV').css('display','block');
	$('#general_mainDIV').css('height',$(window).height() + $(document).height() +'px');
}
function submit_form() {
	document.login_frm.submit();
}
function ajax_logout() {
	loadVeil_logout();
	var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
	width_t=width/2;
	wid_pop=820/2;
	wid=width_t-wid_pop;
	var top = 140;
	$('#popup_logout').css('left',wid+'px');
	$('#popup_logout').css('top',top+'px');
	$('#popup_logout').css('display','block');
}
function show_frontend_popup(div_id) {
	loadVeil_logout();
	var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
	width_t=width/2;
	wid_pop=820/2;
	wid=width_t-wid_pop;
	var top = 140;
	$('#'+div_id).css('left',wid+'px');
	$('#'+div_id).css('top',top+'px');
	$('#'+div_id).css('display','block');
}
function close_frontend_popup(div_id,main_divid)	{
	$('#'+div_id).hide();
	$('#'+main_divid).hide();
}
function close_Div_logout()	{
	document.getElementById('popup_logout').style.display='none';
	document.getElementById('mainDIV_logout').style.display= 'none';
} 
function loadVeil_logout() {
	$('#mainDIV_logout').css('opacity','0.3');
    $('#mainDIV_logout').css('display','block');
	$('#mainDIV_logout').css('height',$(window).height()+'px');
}
///////////////////////////////////////////////////////////////////////////////////////////
function show_change_pass() {	
	document.getElementById('popup_change_pass').innerHTML = '';
	loadVeil_change_pass();
	$('#popup_change_pass').load(baseUrl+"contactinfo/show_changepass/");
	var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
	width_t=width/2;
	wid_pop=820/2;
	wid=width_t-wid_pop;
	var top = 140;
	$('#popup_change_pass').css('left',wid+'px');
	$('#popup_change_pass').css('top',top+'px');
	$('#popup_change_pass').css('display','block');
}
function loadVeil_change_pass() {
	$('#mainDIV_change_pass').css('opacity','0.3');
	$('#mainDIV_change_pass').css('height',$(window).height()+'px');
	$('#mainDIV_change_pass').css('display','block');
}
function close_Div_change_pass() {
    document.getElementById('mainDIV_change_pass').style.display = 'none';
	document.getElementById('popup_change_pass').style.display = 'none';
}
function loadVeil_edit_info() {
	$('#mainDIV_edit_info').css('opacity','0.3');
	$('#mainDIV_edit_info').css('height',$(window).height()+'px');
	$('#mainDIV_edit_info').css('display','block');
}
function close_Div_edit_info() {
    document.getElementById('mainDIV_edit_info').style.display = 'none';
	document.getElementById('popup_edit_info').style.display = 'none';
}
function loadVeil_edit_bank_info() {
	$('#mainDIV_edit_bank_info').css('opacity','0.3');
	$('#mainDIV_edit_bank_info').css('height',$(window).height()+'px');
	$('#mainDIV_edit_bank_info').css('display','block');
}
function close_Div_edit_bank_info() {
    document.getElementById('popup_edit_bank_info').style.display = 'none';
	document.getElementById('mainDIV_edit_bank_info').style.display = 'none';
}
function call_editbankinfo() {
	document.getElementById('popup_edit_bank_info').style.display = 'block';
	// wait for the DOM to be loaded 
	$('#editbankinfo').ajaxSubmit({target:'#popup_edit_bank_info',complete:function(request){
			 var str = request.responseText;
		     done = str.substring(0,4)
			 str= str.substring(4);
			 if (done == 'done')
			 {
				 document.getElementById('my_bank_account').innerHTML=str;
				$('#popup_edit_bank_info').css('display','none');
				$('#mainDIV_edit_bank_info').css('display','none');
			 }
		}
	});
	return false;
}
function close_Div_video() {
	document.getElementById("player1").innerHTML='';
	document.getElementById("popup_video").innerHTML='';
	document.getElementById('popup_video').style.display='none';
	document.getElementById('mainDIV_video').style.display= 'none';
}
function loadVeil_video() {
	$('#mainDIV_video').css('opacity','0.3');
    $('#mainDIV_video').css('display','block');
	$('#mainDIV_video').css('height',$(window).height()+'px');
}
function loadVeil_new_address_info() {
	$('#mainDIV_new_address_info').css('opacity','0.3');
	$('#mainDIV_new_address_info').css('height',$(window).height()+'px');
	$('#mainDIV_new_address_info').css('display','block');
}
function close_Div_new_address_info() {
    document.getElementById('new_address_popup').style.display = 'none';
	document.getElementById('mainDIV_new_address_info').style.display = 'none';
}
function loadVeil_edit_address_info() {
	$('#mainDIV_edit_address_info').css('opacity','0.3');
	$('#mainDIV_edit_address_info').css('height',$(window).height()+'px');
	$('#mainDIV_edit_address_info').css('display','block');
}
function close_Div_edit_address_info() {
    document.getElementById('edit_address_popup').style.display = 'none';
	document.getElementById('mainDIV_edit_address_info').style.display = 'none';
}
function call_editaddressinfo() {
	document.getElementById('edit_address_popup').style.display = 'block';
	// wait for the DOM to be loaded 
	$('#editaddressinfo').ajaxSubmit({target:'#edit_address_popup',complete:function(request){
			var str = request.responseText;
		    done = str.substring(0,4)
			str= str.substring(4);
			if (done == 'done')
			 {
				 document.getElementById('my_address_book').innerHTML=str;
				$('#edit_address_popup').css('display','none');
				$('#mainDIV_edit_address_info').css('display','none');
			 }
		}
	});
	return false;
}
function loadVeil_edit_other_address_info() {
	$('#mainDIV_edit_other_address_info').css('opacity','0.3');
	$('#mainDIV_edit_other_address_info').css('height',$(window).height()+'px');
	$('#mainDIV_edit_other_address_info').css('display','block');
}
function close_Div_edit_other_address_info() {
    document.getElementById('edit_other_address_popup').style.display = 'none';
	document.getElementById('mainDIV_edit_other_address_info').style.display = 'none';
}
function loadVeil_order_new_address() {
	$('#mainDIV_new_address').css('opacity','0.3');
	$('#mainDIV_new_address').css('height',$(window).height()+'px');
	$('#mainDIV_new_address').css('display','block');
}
function close_Div_order_new_address() {
    document.getElementById('new_adress_popup').style.display = 'none';
	document.getElementById('mainDIV_new_address').style.display = 'none';
}
function close_Div_again_Login() {
	document.getElementById('login_popup').style.display = 'none';
	document.getElementById('mainDIV_cart').style.display = 'none';
}
function login_err() {
	Veil_login();
	var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
	width_t=width/2;
	wid_pop=820/2;
	wid=width_t-wid_pop;
	var top = 140;
	$('#popup_error_login').css('left',wid+'px');
	$('#popup_error_login').css('top',top+'px');
	$('#popup_error_login').css('display','block');
	
}
function Veil_login() {
	$('#mainDIV_login').css('opacity','0.3');
	$('#mainDIV_login').css('display','block');
	$('#mainDIV_login').css('height',$(window).height()+'px');
}
function close_Div_login() {
	document.getElementById('popup_error_login').style.display='none';
	document.getElementById('mainDIV_login').style.display= 'none';
}
function showhideDiv1(show_div,hide_div) {
	if(document.getElementById('contactr1').checked==true) {
		document.getElementById('contactr1').unchecked;
		document.getElementById('contactr2').unchecked;
		document.getElementById('contactr2').checked;
		document.getElementById('adrsBtmMgr').style.height='520px';
		//$('#ContactOff_div').css('hieght','415px');
	} else if(document.getElementById('contactr2').checked==true ) {
		document.getElementById('contactr2').unchecked;
		document.getElementById('contactr1').unchecked;
		document.getElementById('contactr1').checked;
		document.getElementById('adrsBtmMgr').style.height='600px';
	}
	$('#'+show_div).css('display','block');
	$('#'+hide_div).css('display','none');

}
function showhideDiv2(show_div,hide_div) {
	$('#'+show_div).css('display','block');
	$('#'+hide_div).css('display','none');
	if(document.getElementById('contactr1').checked==true) {
		document.getElementById('contactr1').unchecked;
		document.getElementById('contactr2').unchecked;
		document.getElementById('contactr2').checked;
	} else if(document.getElementById('contactr2').checked==true ) {
		document.getElementById('contactr2').unchecked;
		document.getElementById('contactr1').unchecked;
		document.getElementById('contactr1').checked;
	}
}

function loadVeil_com_error() {
	$('#general_mainDIV').css('opacity','0.3');
	$('#general_mainDIV').css('display','block');
	$('#general_mainDIV').css('height',$(window).height()+'px');
}

function show_com_error_Div(divtitle,divtext) {
	loadVeil_com_error();
	var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
	width_t=width/2;
	wid_pop=820/2;
	wid=width_t-wid_pop;
	document.getElementById('popup_com_error').style.left = wid+'px';
	document.getElementById('popup_com_error').style.top = 140+'px';
	document.getElementById("popup_com_error").style.display='block';
	document.getElementById('div_com_error_title').innerHTML =divtitle;
	document.getElementById('div_com_error_text').innerHTML =divtext;
}
function close_Div_com_error() {
	document.getElementById('popup_com_error').style.display='none';
	document.getElementById('general_mainDIV').style.display= 'none';
}
function show_com_filetype_Div(divtitle,divtext) {
	loadVeil_com_error();
	var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
	
	width_t=width/2;
	wid_pop=620/3;
	wid=width_t-wid_pop;
	wid=wid/2;
	document.getElementById('popup_com_filetype').style.left = wid+'px';
	document.getElementById('popup_com_filetype').style.top = 140+'px';
	document.getElementById("popup_com_filetype").style.display='block';
	document.getElementById('div_com_filetype_title').innerHTML =divtitle;
	document.getElementById('div_com_filetype_text').innerHTML =divtext;
}
function close_Div_com_filetype() {
	document.getElementById('popup_com_filetype').style.display='none';
	document.getElementById('general_mainDIV').style.display= 'none';
}
function loadVeil_first_time_change_pass() {
	$('#mainDIV_change_pass').css('opacity','0.3');
	$('#mainDIV_change_pass').css('height',$(window).height()+'px');
	$('#mainDIV_change_pass').css('display','block');
}
function close_Div_first_time_change_pass() {
    document.getElementById('mainDIV_change_pass').style.display = 'none';
	document.getElementById('popup_change_pass').style.display = 'none';
}
function show_general_error_popup(img,heading,text,close_funcs) {
		if(close_funcs == 'undefined')
			close_funcs = '';
		loadGeneralVeil();
		$('#top_left_img').attr('src',img);
		$('#err_heading').html(heading);
		$('#err_text').html(text);
		$('#gen_close_span').html('<a href="#" onclick="close_general_Div();'+close_funcs+'"><img src="'+baseUrl+'images/frontend/'+frontLang+'/popup-closs.jpg" border="0" class="fr"  alt=""/></a>');
		var width = (typeof window.innerWidth != 'undefined' ? window.innerWidth : document.body.offsetWidth);
		width_t=width/2;
		wid_pop=820/2;
		wid=width_t-wid_pop;
		var top = 140;
		$('#general_error_popup').css('left',wid+'px');
		$('#general_error_popup').css('top',top+'px');
		$('#general_error_popup').css('display','block');
}
function getposOffset(what, offsettype) {
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null) {
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}
function showhide(obj, e, visible, hidden, menuwidth) {
	if(ie4||ns6)
		dropmenuobj.style.left=dropmenuobj.style.top="-500px"
	if(menuwidth!="") {
		dropmenuobj.widthobj=dropmenuobj.style
		dropmenuobj.widthobj.width=menuwidth
	}
	if(e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
		obj.visibility=visible
	else if (e.type=="click")
		obj.visibility=hidden
}
function iecompattest() {
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function clearbrowseredge(obj, whichedge) {
	var edgeoffset=0
	if(whichedge=="rightedge") {
		var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.	pageXOffset+window.innerWidth-15
		dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
		if(windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
			edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
	} else {
		var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
		var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
		dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
		if(windowedge-dropmenuobj.y < dropmenuobj.contentmeasure) { //move up?
			edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
		if((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
			edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
		}
	}
	return edgeoffset
}
function populatemenu(what) {
	if(ie4||ns6)
		dropmenuobj.innerHTML=what.join("")
}
function dropdownmenu(obj, e, menucontents, menuwidth) {
	if(window.event) event.cancelBubble=true
	else if(e.stopPropagation) e.stopPropagation()
		clearhidemenu()
	dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
	populatemenu(menucontents)
	if(ie4||ns6) {
		showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
		dropmenuobj.x=getposOffset(obj, "left")
		dropmenuobj.y=getposOffset(obj, "top")
		//dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
		dropmenuobj.style.left=735+"px"
		dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
	}
	return clickreturnvalue()
}
function clickreturnvalue() {
	if(ie4||ns6) return false
	else return true
}
function contains_ns6(a, b) {
	while (b.parentNode)
		if ((b = b.parentNode) == a)
			return true;
	return false;
}
function dynamichide(e) {
	if(ie4&&!dropmenuobj.contains(e.toElement))
		delayhidemenu()
	else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
		delayhidemenu()
}
function hidemenu(e){
	if(typeof dropmenuobj!="undefined") {
		if(ie4||ns6)
			dropmenuobj.style.visibility="hidden"
	}
}
function delayhidemenu() {
	if(ie4||ns6)
		delayhide=setTimeout("hidemenu()",disappeardelay)
}
function image_mover(id,name) {
	document.getElementById(id).src= baseUrl+'images/frontend/'+frontLang+'/'+name;
}
function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  	var p,i,x;  
	if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  	if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function updatedivorderid(orderid) {
	$('#div_order_id').html(orderid);
}
function change_button_type(id,name) {
	document.getElementById('image1').src= baseUrl+"images/frontend/"+frontLang+"/btn_produkte.png";
	document.getElementById('image2').src= baseUrl+"images/frontend/"+frontLang+"/btn_bestellablauf.png";
	document.getElementById('image3').src= baseUrl+"images/frontend/"+frontLang+"/btn_druckdaten.png";
	document.getElementById('image4').src= baseUrl+"images/frontend/"+frontLang+"/btn_datenservice.png";
	document.getElementById('image5').src= baseUrl+"images/frontend/"+frontLang+"/btn_lieferzeiten.png";
	document.getElementById('image6').src= baseUrl+"images/frontend/"+frontLang+"/btn_papiermuster.png";
	document.getElementById('image7').src= baseUrl+"images/frontend/"+frontLang+"/btn_diehelden.png";
	document.getElementById('image8').src= baseUrl+"images/frontend/"+frontLang+"/btn_einsteiger.png";
	document.getElementById('image9').src= baseUrl+"images/frontend/"+frontLang+"/btn_kontakt.png";
	document.getElementById(id).src= name;
}
function call_popup_login() {
	$('#login_popup').css('display','block');
	// wait for the DOM to be loaded 
	$('#popuplogin').ajaxSubmit({target:'#login_popup',complete:function(request){
			if (request.responseText == 'success') {
				$('#login_popup').css('display','none');
				$('#mainDIV_cart').css('display','none');
				window.location.href= secureBaseUrl+'order/payment_options';
			} 
			if (request.responseText == 'first_lgin') {
				$('#login_popup').css('display','none');
				$('#mainDIV_cart').css('display','none');
				window.location.href= baseUrl+'registration/registerFirst';
			}
			if(request.responseText == 'inactive_user_by_admin') {
				close_Div_again_Login();
				show_general_error_popup(baseUrl+'images/frontend/'+frontLang+'/fehlerhafte-login.gif','<strong>'+loginErrorUserInactive+'</strong>',loginErrorUserInactiveData);
			} else if(request.responseText == 'err' && request.responseText != 'success') {
				close_Div_again_Login();
				show_general_error_popup(baseUrl+'images/frontend/'+frontLang+'/fehlerhafte-login.gif','<strong>'+loginErrorPopupHeading+'</strong>','<a href="#" style="color:#898989;" onclick="close_general_Div();show_forgotpass();">'+loginErrorPopupHeadingData1+'</a><br/><br/><a href="#" style="color:#898989;" onclick="showLoginFrm();">'+retry+'</a>');
			}
		}
	});
	return false;
}
function loadVeil_login() {
	$('#mainDIV_cart').css('opacity','0');
	$('#mainDIV_cart').css('display','block');
	$('#mainDIV_cart').css('height',$(window).height() + document.documentElement.scrollHeight +'px');
		
}
