function openAGB(welche){
    if (welche == "premium"){
	var agb = "_premium";
    }else{
	var agb = "_basic";
    }
    nw('/agbs/agb'+agb+'.pdf','AGB','500','500','yes','kompakt','nocenter');
}
function gotoPage(page){
    document.ergForm.akt_page.value = page;
    document.ergForm.submit();
}
function openprofil(usr_id){
    //win = open('profil.php?usr_id='+usr_id+'<? if ($PHPSESSID) echo"&PHPSESSID=$PHPSESSID"?>','','width=780,height=550,resizable=yes,scrollbars=yes');
    win = open('/profil.php?usr_id='+usr_id,'Profil'+usr_id,'width=780,height=550,resizable=yes,scrollbars=yes');
    if(!win){
    	alert ('Bitte lasse Popups auf dieser Seite zu um das System vollst&auml;ndig nutzen zu k&ouml;nnen\n\nPlease accept popups at this website for using the system completely');
    }else{
	win.moveTo((screen.width-750)/2,(screen.height-550)/2);
	//win.focus();
    }
}
function nw(url, name, wid, hei, scrolls, view, pos){
    var params = "";        
    params = params+"height="+hei+", ";
    params = params+"width="+wid+", ";
    params = params+"scrollbars="+scrolls+", ";
    if(view == "kompakt"){
    	params += "toolbar=no, location=no, menubar=no, status=no, resizable=yes";	
    }else if(view=="kompakt_noresize"){
        params += "toolbar=no, location=no, menubar=no, status=no, resizable=no";
    }else{
	params += "toolbar=yes, location=yes, menubar=yes, status=yes";    
    }
    win = window.open(url, name, params);
    if (pos != "nocenter"){
	try{
    	    win.moveTo((screen.width-wid)/2,(screen.height-hei)/2);
    	    win.focus();
	}catch(e){}
    }
}
function fixPNG(myImage){
    var arVersion = navigator.appVersion.split("MSIE");
    var version = parseFloat(arVersion[1]);
    if ((version >= 5.5) && (version < 7) && (document.body.filters)){
        var imgID = (myImage.id) ? "id='" + myImage.id + "' " : "";
        var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : "";
        var imgTitle = (myImage.title) ? "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' ";
        var imgStyle = "display:inline-block;" + myImage.style.cssText;
        var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" 
	+ "width:" + myImage.width + "px; height:" + myImage.height + "px;" + imgStyle + ";"
	+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
	+ "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>";
	myImage.outerHTML = strNewHTML;
    }
}
function openPrivatChat(params) {    
    nw('nw.php?site=privatchat&params='+params,'','560','410','yes','kompakt');
}
function showUserdetails(ben_id){
    nw('nw.php?site=favoriten/userdetails&logincheck=1&ben_id='+ben_id, 'view_userdetails', '540', '635', 'yes', 'kompakt');
}
function showUserPic(id){
    nw('nw.php?logincheck=1&site=showuserpic&id='+id,'showUserPic','680','580','1','kompakt');
}
function showClubPic(id){
    nw('/nw.php?logincheck=1&site=showclubpic&id='+id,'showClubPic','680','580','1','kompakt');
}
function showChartPic(id){
    nw('/nw.php?logincheck=1&site=showchartpic&id='+id,'showChartPic','680','580','1','kompakt');
}
function showPremiumPic(id){
    nw('nw.php?site=showpremiumpic&logincheck=1&id='+id,'showPremiumPic','680','580','1','kompakt');
}
function showVideo(id){
    nw('nw.php?global=1&site=showvideo&logincheck=1&id='+id,'showVideo','700','600','1','kompakt');
}
function getCountriesMain(bland,landID,divid,col,sel){
    if (landID){
    	$("#geo_stadt").css("display","block");
	$("#geo_stadt_ausg").html("<img src=\"/images/ajax-loader.gif\">");
	$.ajax({
    	    type: "POST",
    	    url: "../sites/getAjax.php",
	    data: "landid="+landID+"&p=geoCountries&col="+col+"&divid="+divid+"&sel="+sel+"&bland="+bland,
	    success: function(data_countries){
	        $("#geo_stadt_ausg").html(data_countries);
	    }
	});
    }
}
function getCountriesClub(bland,landID,divid,col,sel){
    if (landID){
    	$("#geo_stadt").css("display","block");
	$("#geo_stadt_ausg"+divid).html("<img src=\"/images/ajax-loader.gif\">");
	$.ajax({
    	    type: "POST",
    	    url: "../sites/getAjax.php",
	    data: "landid="+landID+"&p=geoCountriesClub&col="+col+"&id="+divid+"&sel="+sel+"&bland="+bland,
	    success: function(data_countries){
	        $("#geo_stadt_ausg"+divid).html(data_countries);
	    }
	});
    }
}
function getBlandMain(landID,divid,col,sel){
    if (landID){
    	$("#geo_bland").css("display","block");
	$("#geo_bland_ausg").html("<img src=\"/images/ajax-loader.gif\">");
	$.ajax({
    	    type: "POST",
    	    url: "../sites/getAjax.php",
	    data: "landid="+landID+"&p=geoBLand&col="+col+"&divid="+divid+"&sel="+sel,
	    success: function(data_bland){
	        $("#geo_bland_ausg").html(data_bland);
	    }
	});
    }
}
function showUserVideo(welches){
    win = open('nw.php?site=uservideos/player&id='+welches,'ShowUservideo','width=364, height=385');
    win.moveTo((screen.width-364)/2,(screen.height-385)/2);
}
function showUserUploadVideo(welches){
    win = open('nw.php?site=uservideos/uploadedvideo&id='+welches,'ShowUservideo','width=364, height=385, resizable=yes');
    win.moveTo((screen.width-364)/2,(screen.height-385)/2);
}
function openclubprofil(club_id){
    win = open('/sites/clubprofil/index.php?club_id='+club_id,'','width=780,height=550,resizable=yes,scrollbars=yes');
    if(!win){
    	alert ('Bitte lasse Popups auf dieser Seite zu um das System vollständig nutzen zu können\n\nPlease accept popups at this website for using the system completely');
    }else{
	win.moveTo((screen.width-750)/2,(screen.height-550)/2);
	win.focus();
    }
}
function openkontaktanzeige(anz_id, usr_id){
    nw('nw.php?site=showanzeige&anz_id='+anz_id, 'anzeige'+anz_id, '650', '500', 'yes', 'kompakt')
}
function trim(val){
    return(val.replace(/\s+/g," ").replace(/\s+$/,"").replace(/^\s+/,"").replace(/\s+/g,""));
}
function trimSimple(val){
    return(val.replace(/\s+/g," ").replace(/\s+$/,""));
}
function showFeedPage(page){
    if (page){
	$.ajax({
    	    type: "POST",
    	    url: "../sites/getAjax.php",
	    data: "&p=module1.inc&page="+page,
	    success: function(data_feed){
	        $("#outputfeed").html(data_feed);
	    }
	});
    }
}
