function callGallery(name) {
	window.open("gallery.php?img="+name,"Tunerland","width=665,height=550,resizable=yes,scrollbars=yes,location=no,directories=no,menubar=no,toolbar=no");
}

function meldung(r,id,m) {
	window.open("meldung.php?rubrik="+r+"&rubrik_id="+id+"&text="+m,"Tunerland-Meldung","width=350,height=150,resizable=no,scrollbars=no,location=no,directories=no,menubar=no,toolbar=no");
}


function saveResolution(value) {
var x = 0;
var y = 0;

		x = screen.width;
		y = screen.height;
		
		AjaxHTTPGet("phpscript/ajax_track.php?track_id="+value+"&value="+x+" x "+y, AjaxAufloesung);
}

function AjaxAufloesung(HttpRequest) {
    
	if (HttpRequest.readyState == 4) {
        if (HttpRequest.status == 200 || !HttpRequest.status) {
			var response = HttpRequest.responseText;            
			}
	}
}

function AlbumValueUpdate() {
    
	if (HttpRequest.readyState == 4) {
        if (HttpRequest.status == 200 || !HttpRequest.status) {
			var response = HttpRequest.responseText;            
            if (response == "&nbsp;") {
                if (current_div.id.indexOf("Title") != -1) {
                    response = '<?=addslashes($photo_str_add_title)?>';
                } else {
                    response = '<?=addslashes($photo_str_add_description)?>';
                }
            }
			if (current_div && current_div.innerHTML) {
				current_div.innerHTML=response;
				current_div.style.background='#FFFFFF';
			} else {
				alert(response);
			}
		} else {
            alert("Error: status code is " + HttpRequest.status);
		}
	}
    
	lock = 0;
}


function getRect (o)
{
    var r = { top:0, left:0, width:0, height:0 };

    if(!o) return r;
    else if(typeof o == 'string' ) o = document.getElementById(o);
    
    if( typeof o != 'object' ) return r;

    if(typeof o.offsetTop != 'undefined')
    {
         r.height = o.offsetHeight;
         r.width = o.offsetWidth;
         r.left = r.top = 0;
         while (o && o.tagName != 'BODY')
         {
              r.top  += parseInt( o.offsetTop );
              r.left += parseInt( o.offsetLeft );
              o = o.offsetParent;
         }
    }
    return r;
}

function getDivBox(id,id_ref,plus){

			
		var r = getRect(id_ref);
		document.getElementById(id).style.top = r.top; 
		document.getElementById(id).style.left =(r.left+plus);
}
function closeDivBox(id){

		document.getElementById(id).style.top = -200; 
		document.getElementById(id).style.left = -200;
}

function select_all(status) {
   for (i=0;i<document.pn.length;i++) {
    if(document.pn.elements[i].name=="pn[]") document.pn.elements[i].checked = status;
   }
  }
  

