// Popup
function pU(url,name,breite,hoehe,parameter,extern)
{
	((parameter.indexOf("scrollbars=no") >= 0) || (parameter.indexOf("scrollbars=0") >= 0)) ? k = 0 : k = 17;
	p = "width=" + (parseInt(breite) + k) + ",height=" + hoehe + "," + parameter;
	ext = url.split(".");
	
	((ext[ext.length - 1] == 'gif') || (ext[ext.length - 1] == 'jpg')) ? ext = '&type=pic' : ((ext[ext.length - 1] == 'swf') ? ext = '&type=swf' : ext = '');
	if (name == 'neu') name = 'a' + Math.round(Math.random() * 10000);
	if (extern == 1) win = window.open(url,name,p);
	win = window.open(url + ext + '&breite=' + breite + '&hoehe=' + hoehe,name,p);
	
	win.focus();
}

// Popup2
function wo(url,name,breite,hoehe,parameter)
{
	win = window.open(url,name,'width=' + breite + ',height=' + hoehe + ',' + parameter);
	win.focus();
}

// Merken
function bookmark()
{ if (!document.layer) { window.external.AddFavorite(eval(self.location),document.title); } }

// Drucken
function drucken(page)
{ wo(page,'Detail',550,400,'scrollbars=yes,status=yes',1); }

// DetailPop für Thumbnails
function detail(id)
{ wo('/details/detail.php5?id=' + id,'Detail',550,400,'scrollbars=yes,status=yes',1); }

// DetailPop für ctxTeaser
function detailpopup(id)
{ wo('/PopUp/' + id + '.aspx' ,'Detailpop',550,400,'scrollbars=yes,status=yes',1); }

// DetailPop für ctxTeaser
function blankpopup(id)
{ wo('/PopUp/'+id+'.aspx','Detailpop',550,400,'scrollbars=yes,status=yes',1); }



//#################################################################
// Context FlashMovies --->!!! DIE HIER ISSET; LIEBER SÖNKE... ;o) !!! ###################
//#################################################################
var isIE = navigator.appName.toLowerCase().indexOf('internet explorer')+1;

Player = function(id) {
	this.id = id;
	this.o = this.getPlayer();
}
Player.prototype.getPlayer = function() {
	var idstr = (isIE) ? this.id + "_ie" : this.id + "_moz";
	var p = document.getElementById(idstr);
	return p;
}
Player.prototype.setVariable = function(name, value) {
	this.o.SetVariable(name, value);
}
Player.prototype.getVariable = function(name) {
	return this.o.GetVariable(name);
}
Player.prototype.startMovie = function(daten) {
	this.setVariable("_root.controller.loadNewMovie", daten);
}


function init()
{ document.vidPlayer = new Player("movieVideo"); }
window.onload = init;


// Einblendfunktion
function showme(id){ 
	document.getElementById(id).style.display = ""; 
}

// Ausblendfunktion
function hideme(id)
{ document.getElementById(id).style.display = "none"; }

// Ein-/ Ausblendfunktion
function changer(id)
{
	if (document.getElementById(id).style.display == "none") {
		showme(id);
	} else {
		hideme(id);
	}
}

// Heizkostenvergleich
function heizkostenvergleich() {
//wo('http://hkn.sec2-server.de/index.php?portal_id=waterkotte', 'heizrechner', 502, 600, 'menu=no, toolbar=no, status=yes'); 
wo('https://ratgeber.co2online.de/index.php?berater=heizkostenimneubau&portal_id=waterkotte', 'heizrechner', 502, 600, 'menu=no, toolbar=no, status=yes');
}

// MessepopUp
function infoMesse(messeID){
	winName = "water"// + Math.round(Math.random()*10000);
    win = window.open("/messePop.aspx?id="+messeID,winName,"width=300,height=250,scrollbars=no");
    win.focus();
}

// ********************* PostBack Functions ********************************

function SetPostBackFunction(eventTarget, eventArgument){
	if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
    }
}

function ClearPostBackFunction(){
	if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = "";
        theForm.__EVENTARGUMENT.value = "";
    }
}

function toggle(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}