function lk_action(ar){

	if(ar == 1){
		if(CheckboxValidate() == true){
			top.leuchtkasten.document.lk_action.target = 'imagebank';
			top.leuchtkasten.document.lk_action.action = pro_path;
			top.leuchtkasten.document.lk_action.submit();
		}
	}
	else if(ar == 2){
		if(CheckboxValidate() == true){
			top.leuchtkasten.document.lk_action.target = 'imagebank';
			top.leuchtkasten.document.lk_action.action = pdf_path;
			top.leuchtkasten.document.lk_action.submit();
		}
	}
	else if(ar == 3){
		if(CheckboxValidate() == true){
			top.leuchtkasten.document.lk_action.submit_mode.value = 4;
			top.leuchtkasten.document.lk_action.submit();
		}
	}
	else if(ar == 4){
		show_hide('move','block');
	}
	else if(ar == 5){
		if(CheckboxValidate() == true){
			top.leuchtkasten.document.lk_action.submit_mode.value = 5;
			top.leuchtkasten.document.lk_action.lk_id.value = document.select_lk_form.lk_id.value;
			top.leuchtkasten.document.lk_action.new_lk_id.value = document.move_images.move_lk_id.value;
			top.leuchtkasten.document.lk_action.submit();
		}
	}
	else if(ar == 6){
		if(CheckboxValidate() == true){
			top.leuchtkasten.document.lk_action.target = 'imagebank';
			top.leuchtkasten.document.lk_action.action = cpt_path;
			top.leuchtkasten.document.lk_action.submit();
		}
	}
	else if(ar == 7){
		if(CheckboxValidate() == true){
			top.leuchtkasten.document.lk_action.target = 'imagebank';
			top.leuchtkasten.document.lk_action.action = slide_path;
			top.leuchtkasten.document.lk_action.submit();
		}
	}
	else if(ar == 9){
		if(CheckboxValidate() == true){
			top.leuchtkasten.document.lk_action.target = 'imagebank';
			top.leuchtkasten.document.lk_action.action = zip_path;
			top.leuchtkasten.document.lk_action.submit();
		}
	}
}


function reset_form(){
	document.advancedsearch.search_keyword1.value = '';
	document.advancedsearch.search_keyword2.value = '';
	document.advancedsearch.search_keyword3.value = '';
	document.advancedsearch.search_keyword4.value = '';
	document.advancedsearch.kat_id.options.selectedIndex = 0;
	document.advancedsearch.motto_id.options.selectedIndex = 0;
	document.advancedsearch.search_date.options.selectedIndex = 0;
	document.advancedsearch.search_limit.options.selectedIndex = 0;
	document.advancedsearch.search_method.options.selectedIndex = 0;
	document.advancedsearch.rechte_mode.options.selectedIndex = 0;
}
function swap_lk_id(){
	document.action_lk_form.lk_id.value = document.select_lk_form.lk_id.value;
}
function CheckboxValidate(){
	var erg = false;
	var checkbox = top.leuchtkasten.document.getElementsByName('select_img[]')
	for (var i=0; i<checkbox.length; i++){
   		if (checkbox[i].checked == true){
      		return true;
		}
	}
	if (erg == false){
		alert(checkbox_msg);
		return false;
	}
}

function PopUp(url) {
	var breite = 595;
	var hoehe = 842;
	links = (screen.width/2)-(breite/2);
    oben = (screen.height/2)-(hoehe/2);
    window.open(url,"popup","height="+hoehe+",width="+breite+",status = no,toolbar = no,menubar = no,location = no,resizable = no,titlebar = no,scrollbars = no,fullscreen = no,top ="+oben+",left ="+links);
   }

function statusleiste(ar){
	window.status = ar;
	return true;
}

//zum auslesen der windowsweite für news
function getClientWidth() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
 return myWidth;	
}


function BrowserDetection(){

	var agent = navigator.userAgent; 
	var appli = navigator.appName; 
	var Browser = ''; 
	
	if(agent.search('MSIE 6') != -1){ 
 		Browser = 'IE6'; 
	}
	else if(agent.search('MSIE 5') != -1){
		Browser = 'IE5'; 
	}
	else if(agent.search('MSIE 7') != -1){
		Browser = 'IE7';
	} 
	else if(agent.search('MSIE 8') != -1){
		Browser = 'IE8';
	} 
	else if(appli == 'Netscape' && agent.search('Netscape/7') != -1){
		Browser = 'NS7';
	}
	else if(appli == 'Netscape' && agent.search('Netscape/6') != -1){
		Browser = 'NS6';
	}
	else if(agent.search('Firefox/1') != -1){
		Browser = 'FF1';
	}
	else if(agent.search('Firefox/2') != -1){
		Browser = 'FF2';
	}
	else{
		Browser = 'NN';
	}
	
	if(agent.search('Opera 8') != -1 && agent.search('MSIE') != -1){
		Browser = 'O8';
	}
	else if(agent.search('Opera 6') != -1 && agent.search('MSIE') != -1){
		Browser = 'O6';
	}
	else if(agent.search('Opera 7') != -1 && agent.search('MSIE') != -1){
		Browser = 'O7';
	}
	else if(agent.search('Opera 9') != -1 && agent.search('MSIE') != -1){
		Browser = 'O9';
	}
	
	return Browser;
}

function lk_box(ar){

	var agent = BrowserDetection();
	
	if(ar == 'hide'){
		if (document.getElementById){
			if (agent == 'IE5' || agent == 'IE6' || agent == 'IE7' || agent == 'IE8'){
				document.getElementById('lk_box1').style.display = 'block';
				document.getElementById('lk_box2').style.display = 'none';
			}
			else if (agent == 'O6' || agent == '07' || agent == '08' || agent == 'O9'){
				document.getElementById('lk_box1').style.display = 'table-row';
				document.getElementById('lk_box2').style.display = '';
			}
			else{
				document.getElementById('lk_box1').style.display = 'table-row';
				document.getElementById('lk_box2').style.display = 'none';
			}
		}
	
		else if (document.layers){
			document.layers['lk_box1'].display = 'table-row';
			document.layers['lk_box2'].display = 'none';
		}
		else if (document.all){
			document.all['lk_box1'].style.display = 'block';
			document.all['lk_box2'].style.display = 'none';
		}
	}
	else if(ar == 'show'){
		if (document.getElementById){
			if (agent == 'IE5' || agent == 'IE6' || agent == 'IE7' || agent == 'IE8'){
				document.getElementById('lk_box1').style.display = 'none';
				document.getElementById('lk_box2').style.display = 'block';
			}
			else if (agent == 'O6' || agent == '07' || agent == '08' || agent == 'O9'){
				document.getElementById('lk_box1').style.display = '';
				document.getElementById('lk_box2').style.display = 'table-row';
			}
			else{
				document.getElementById('lk_box1').style.display = 'none';
				document.getElementById('lk_box2').style.display = 'table-row';
			}
		}
		else if (document.layers){
			document.layers['lk_box1'].display = 'none';
			document.layers['lk_box2'].display = 'table-row';
		}
		else if (document.all){
			document.all['lk_box1'].style.display = 'none';
			document.all['lk_box2'].style.display = 'block';
		}
	}
}

function show_hide(container,mode){
	if (document.layers){
		document.layers[container].display = mode;
	}
	else if (document.all){		
		document.all[container].style.display = mode;
	}
	else if (document.getElementById){
		document.getElementById(container).style.display = mode;
	}
}

