	var active_hover = '#FFE66B';
	var progress_interval = null;


	function displayWindow(url, width, height) {
		var winname;
		var startx = Math.round((screen.width-width)/2) - 10;
		var starty = Math.round((screen.height-height)/2) - 20;

		d = new Date;
	  	t = d.getTime();

		if ((url.indexOf('http://') == -1) && (php_sid))
			url = url + (url.indexOf('?') == -1?"?":'&') + php_sid;

//		window.onerror = null;
		winname = window.open(url,"Window" + t,"width=" + width + ",height=" + height + ",status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=no,screenX=" + startx + ",left=" + startx + ",screenY=" + starty + ",top=" + starty + " "); 

		if (! winname)
			alert('Das angeforderte Fenster konnte nicht geöffnet werden. Bitte den PopUp-Blocker deaktivieren!');

	}   


	function displayWindowScroll(url, width, height) {
		var winname;
		var startx = Math.round((screen.width-width)/2);
		var starty = Math.round((screen.height-height)/2);

		d = new Date;
	  	t = d.getTime();

		if ((url.indexOf('http://') == -1) && (php_sid))
			url = url + (url.indexOf('?') == -1?"?":'&') + php_sid;

//		window.onerror = null;
		winname = window.open(url, "Window" + t,"width=" + width + ",height=" + height + ",status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes,screenX=" + startx + ",left=" + startx + ",screenY=" + starty + ",top=" + starty + " "); 

		if (! winname)
			alert('Das angeforderte Fenster konnte nicht geöffnet werden. Bitte den PopUp-Blocker deaktivieren!');

	}

	function createLayer(name, text, width, height) {
		document.write('<div id="' + name + '" style="position:absolute;left:' + ((screen.width-width)/2) + 'px;top:' + ((screen.height-height)/2) + 'px;layer-background-color:#FFE66B;background-color:#FFE66B;width:' + width + ';height:' + height + ';visibility:hidden; border:1px solid black;">' + text + '</div>');
	}
	

	function openpopup() {
		var winname;
 		winname = window.open("http://www.hot-deals.de/myownmusic/" + php_date + "/frame.html","HotDeals","width=270,height=300,screenX=450,left=450,screenY=300,top=300");
	}



	function findObj(n, d) { 
  		var p,i,x;  

		if (!d) d=document; 
		if ((p=n.indexOf("?"))>0&&parent.frames.length) {
    		d=parent.frames[n.substring(p+1)].document; 
			n=n.substring(0,p);
		}

	 	if (! (x=d[n]) && d.all) 
			x=d.all[n]; 
		
		for (i=0; !x && i<d.forms.length; i++) 
			x=d.forms[i][n];

		for (i=0; !x && d.layers && i<d.layers.length; i++) 
			x=findObj(n,d.layers[i].document);
			
  		if(!x && d.getElementById) 
			x=d.getElementById(n); 
			
		return x;
	}

	function ShowHideLayers(name, status) { 
  		var v,obj;

		if ((obj=findObj(name))!=null) { 
			v=status;
    		if (obj.style) { 
				obj=obj.style; 
				v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
			}
    		obj.visibility=v; 
		}
	}

	function DisplayHideLayers(name, status) { 
  		var v,obj;

		if ((obj=findObj(name))!=null) { 
			v=status;
    		if (obj.style) { 
				obj=obj.style; 
				v=(v=='show')?'block':(v=='hide')?'none':v; 
			}
    		obj.display=v; 
		}
	}

	function SwapDisplayLayers(name) { 
  		var v,obj;

		if ((obj=findObj(name))!=null) { 
			v=obj.style.display;
    		if (v == 'block') 
				obj.style.display = 'none'
			else
				obj.style.display = 'block'			
		}
	}

	function set_cookie ( name, value)	{
	  var cookie_string = name + "=" + escape ( value );
	  document.cookie = cookie_string;
	}
	
	
	function get_cookie ( cookie_name )	{
	  var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );
	
	  if ( results )
		return ( unescape ( results[1] ) );
	  else
		return null;
	}
	
	function delete_cookie ( cookie_name ) {
	  var cookie_date = new Date ( );  // current date & time
	  cookie_date.setTime ( cookie_date.getTime() - 1 );
	  document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
	}
	
	



	function browserCron_ajax() {

 		$.ajax({
			url: 		'browser_cron_ajax.php',
			type: 		"GET",
			data: 		({sessionid: php_sessionid}),
			dataType: 	"json",
			success: 	function(response){ 

				if (response.friends)
					for (var i = 0; i < response.friends.length; i++) 
						displayWindow("execute.php?action=friends_info_window&friend_id=" + response.friends[i], 350, 100);


				if (response.mails) 
					for (var i = 0; i < response.mails.length; i++) 
						displayWindow("execute.php?action=mails_info_window&num=1", 350, 100);
					
								

				if (response.im_message)
					for (var i = 0; i < response.im_message.length; i++) 
						displayWindow("im_show.php?toid=" + response.im_message[i], 550, 320);


				if (response.friend_im) {
					var new_content = '';
					for (var i = 0; i < response.friend_im.length; i++) 
						new_content += '<a href="javascript: void 0;" onClick="displayWindow(\'im_show.php?toid=' + response.friend_im[i].id + '\', 550, 320);"><img src="images/status/' + response.friend_im[i].icon + '.gif" border="0"> ' + decodeURIComponent(response.friend_im[i].nick) + '</a>';
					$('#mom_im').html(new_content);
				} 
				else
					$('#mom_im').html('&nbsp; Keine Freunde online.');

			}
			
		});
	}	


	function confirmQuestion(question, url) {  
		var box=window.confirm(question);
		
		if (box==true) 
			document.location.href = url;
	
	} 


	function add_clone(name1, name2) {
		ref = document.getElementById(name2).cloneNode(true);
		document.getElementById(name1).appendChild(ref);
	}
	
	
	function remove_clone(name1) {
	
		var test = document.getElementById(name1);
		var counter = 0;
	
		for (var i=0; i<test.childNodes.length; i++) {
			if(test.childNodes[i].nodeName=='#text') continue;
			counter++;
		}
	
		if (counter > 1)
			document.getElementById(name1).removeChild(document.getElementById(name1).lastChild);
	}

	function remove_child(name1, this_id) {
		document.getElementById(name1).removeChild(this_id);
	}


-->
