function fopen() 
{
  neu = open('mm.php', '', 'width=320 height=290');
  neu.moveTo(50,50);
}
function fopen_bewertungen() 
{
  neu = open('bewertungen_all.php', '', 'width=320 height=440');
  neu.moveTo(50,50);
}

function fopen5() 
{
  neu = open('preisliste_poster.pdf');
  neu.moveTo(50,50);
}
function flashopen() 
{
  neu = open('http://get.adobe.com/de/flashplayer/');
  neu.moveTo(50,50);
}
//This script detects the following:
//Flash
//Windows Media Player
//Java
//Shockwave
//RealPlayer
//QuickTime
//Acrobat Reader
//SVG Viewer
function flashdetector(){
var agt=navigator.userAgent.toLowerCase();
var ie  = (agt.indexOf("msie") != -1);
var ns  = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);

if (ie && win) {	pluginlist = detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash"); }
//if (ie && win) {	pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + detectIE("PDF.PdfCtrl.5","Acrobat Reader"); }
if (ns || !win) {
		nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
		pluginlist = detectNS("application/x-shockwave-flash","Shockwave Flash");
//		pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","Acrobat Reader");
}

function detectIE(ClassID,name) { result = false; document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCR'+'IPT>\n'); if (result) return name+','; else return ''; }
function detectNS(ClassID,name) { n = ""; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n; }

pluginlist += navigator.javaEnabled() ? "Java," : "";
if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);



//Beispiel - "Flash"
if (pluginlist.indexOf("Flash")!=-1)
return true;
else return false;

//Beispiel - "Flash"
//if (pluginlist.indexOf("Flash")!=-1)
//document.write("Sie haben Flash installiert<br>")
//else document.write("Sie haben KEIN Flash installiert<br><a href='video.php'> Filme auf DVD </a>")

//if (pluginlist.indexOf("Windows Media Player")!=-1)
//document.write("Sie haben den Windows Media Player installiert<br>")

}
function fopen6() 
{
  neu = open('Fotos24-Preisliste.pdf');
  neu.moveTo(50,50);
}
function fopen7() 
{
  neu = open('versandinfo.php', '', 'width=320 height=330');
  neu.moveTo(50,50);
}

function PayPalalert()
{
alert("mein anzuzeigender Text");
}

// opens or closes objs //
function openDiv(id){
	obj=document.getElementById(id);
	if(obj.style.display=='none'){
		obj.style.display='';
	}else{
		obj.style.display='none';
	}
}
function setProgressBar () {
 	setTimeout("StartAnimation()", 500);
	document.getElementById("progress").style.visibility="visible";
  return true;
}
function StartAnimation(){
	 if (document.images) document['prbar'].src = "gifs/animation.gif"; 
}

function setFormatBar () {
	document.getElementById("form1").style.visibility="visible";
  return true;
}


function material_show()
{
window.open("../material.php",null,"height=445,width=470,status=0,titlebar=no,resizable=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
}
function gallerie_show()
{
window.open("../fotogalerie/index.htm",null,"height=520,width=750,status=0,titlebar=no,resizable=no,toolbar=no,menubar=no,location=no,scrollbars=no");
}

function daten_show()
{
neu = open('konto_aendern1.php','','height=590 width=500');
neu.moveTo(50,50);
}

function warenkorb_fenster_show() 
{
  neu = open('print_warenkorb.php', '', '');
}

function closeDiv(id){
	obj=document.getElementById(id);
	obj.style.display='none';
}

function showDiv(id){
	obj=document.getElementById(id);
	obj.style.display='';
}
function contactShowDiv(id){
	closeDiv('Baucenter');
	closeDiv('Immocenter');
	closeDiv('Finanzcenter');
	closeDiv('Immobienverwaltung');
	showDiv(id);

}

function setK(id){
	document.getElementById('A').style.display='none';
	document.getElementById('B').style.display='none';
	document.getElementById('C').style.display='none';
	document.getElementById('D').style.display='none';
	document.getElementById('E').style.display='none';
	document.getElementById('F').style.display='none';
	
	document.getElementById(id).style.display='';
	document.getElementById(id).style.height='250px';

}


function openObject(id,open){
	
	obj=document.getElementById(id);
	if(open==1){
		obj.style.display='';
	}else{
		obj.style.display='none';
	}
}

function sure(txt,value){
	if(value=='l chen'){
		return confirm("Wirklich l chen '" + txt + "' ?");
	}else{
		return true;
	}
}


function popUp(URL) {
	day = new Date();
	id = day.getTime();
	window.open(URL,'USR_MSG', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=600,left = 490,top = 362');
}



function bankValidate(){
	
	if(document.getElementById('payment_type').value==1){
		r = validate('f1','kontoname,null,null,Kontoinhaber','kontonr,int,9,Konto-Nr.','blz,int,8,BLZ','bank,null,null,Bank' ); 
		if(r==true){
			document.getElementById('f1').submit();
		}
	}else{
		document.getElementById('f1').submit();
	}
}


function selectBox(num) {
    var Object = getObject(num);
    if (Object != null) {
        Object.style.visibility = "visible";
    }
}

function deselectBox(num) {
    var Object = getObject(num);
    if (Object != null) {
        Object.style.visibility = "hidden";
    }
}

/*****************************************************************************************************
Under GPL
Timor(at)cyhex.com

* type = { int, float, text, email, url, null=string }
validate(form,'fieldname,type,minlen,name',fieldname2,type,minlen,name',...)
		
example:					    
onClick="validate('f1','comment,,5,anmerkung','fname,email,5,email'); return document.formSubmit;")
******************************************************************************************************/
		
	function validate(){
		var arr;
		var args = validate.arguments;
		var error = "";
		var f = args[0]; // get the form
		
		   for(i = 1; i < args.length; i++) {
			arr = args[i].split(",");
			
			var element = document.forms[f].elements[arr[0]];
			var type = arr[1];
			var len = arr[2];
			var name = arr[3];
			
				if(!valid(element.value,type,element,len)){
					error += 'Ungültig:  ' + name;
					if(len>0)
						error += ', Min: ' + len;
					error += "\n";
				}
			}
		if(error != ""){
			alert(error);
			return false;
		}else{
			document.forms[f].submit();
			return true;
		}
	}
		
	
	function valid(value,type,element,len){
		
		if(value == "")
			return false;
			
		if(len > 0 &&  value.length < len)
			return false;
			
		switch(type){
			case "int":
				if(isNaN(parseInt(value)))
					return false;
				break;
			case "float":
				if(isNaN(parseFloat(value)))
					return false;
				break;
			case "email":
				
				var valid_mail = /^[a-z0-9._-]+@[a-z0-9A-Z       .-]+\.[a-z]{2,4}$/i;
				if(value.search(valid_mail) == -1)
					return false;
				break;
			case "url":
				var valid_url = /^(https?|ftp):\/\/([a-z0-9._-]+:[a-z0-9._-]+@)?[a-z0-9A-Z       #._\/~% -]+(\?([a-z0-9_-]+(=[a-zA-Z0-99       +%?_-]+&?)?)*)?$/i;
				if(value.search(valid_url)== -1)
					return false;
				break;	
			case "checked":
				if(!element.checked)
					return false;
				break;
		}
		return true;
	}

	function test(str){
		alert(str);
	}
	
	
	
	
	
	
	

