function load_image(id)
{
	document.getElementById('detail-image').src = id;
}
function popup(w, h, url){
    x = screen.availWidth / 2 - w / 2;
    y = screen.availHeight / 2 - h / 2;
    var popupWindow = window.open(url, '', 'width=' + w + ',height=' + h + ',left=' + x + ',top=' + y + ',screenX=' + x + ',screenY=' + y + ',scrollbars=no');
}

// JavaScript Document
function checkForm(formID)
{
        myForm = document.getElementById(formID);
        if (typeof(myForm) != "object") return false;
        myElements = myForm.elements;
        myError = new Array();
        for (f=0; f<myElements.length; f++){
               myElement = myElements[f];
               if (myElement.id.indexOf('_req') != -1){
                       // REQUIRED FIELD
                       if (myElement.id.indexOf('_em') != -1){
                               if(myElement.value == "" || myElement.value.indexOf('@') == -1 || myElement.value.lastIndexOf('.') <= myElement.value.indexOf('@')){
                                      myError.push(myElement);
                               }
                       } else if (myElement.value == "" || (myElement.type == "checkbox" && myElement.checked != true)) {
                               myError.push(myElement);
                       }
               }
        }
        if (myError.length > 0){
				alert("Bitte füllen Sie alle Pflichtfelder aus!");
				// alert(myError[0].id);
				myError[0].focus();
               return false;
        } else { 
               return true;
        }
        return false;
}

function PPAFlash(){
    Flash = "0";
    if (navigator.plugins && navigator.plugins.length){
        for (K=0; K<navigator.plugins.length; K++){
            if (navigator.plugins[K].name.indexOf('Shockwave Flash') != -1){
                Flash = navigator.plugins[K].description.split('Shockwave Flash ')[1];
                break;
            }
        }
    } else if (window.ActiveXObject) {
        for (var K = 10; K >= 2; K--){
            try {
                FlashTest = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + K + "');");
                if (FlashTest) {
                    Flash = K + '.0';
                    break;
                }
            } catch (e) {}
        }
    }
    return Flash;
}
function check_flash()
{
	if(PPAFlash()==0)
	{
		document.getElementById('no_flash').style.display = "block";
		document.getElementById('header-image').style.display = "none";
	}
	else
	{
		document.getElementById('no_flash').style.display = "none";
		document.getElementById('header-image').style.display = "block";	
	}
}

function change_focus(obj, chars, fields)
{
	if(obj.id < fields)
	{
		if(obj.value.length >= chars)
		{
			obj.blur();
			document.getElementById((obj.id*1+1)+"").focus();
		}
	}
}
