var newWin;



function linkl(){
	var a=3;
	var i=1; 
    for(i=1;i<=12;i++){
        var el1=document.getElementById('l'+i);
        var el2=document.getElementById('ll'+i);
        
        var re = /galery/;
		var result = re.test(location.href);
		if(result) result = re.test(el1.href);
        if(result) {
        	el1.style.color='#ff3300';
        	el2.style.color='#ff3300';
        }
        if(el1.href==location.href){
        	el1.style.color='#ff3300';
        	el2.style.color='#ff3300';
        }
    }

}

function foto(file,name,description,w,h){
if(newWin) newWin.close();
var newWin;
var content = '<html><head><title>'+name+'</title></head><body style="margin:10 15 0 15px;padding:0px;" background="">';
   content += '<img src="'+file+'" alt="'+description+'" width="'+w+'" height="'+h+'"  onclick="self.close()" /><br />';   
   content += '<small>'+description+'</small></body></html>';
   newWin=window.open("",'foto',"top=100,left=100,width="+(w+30)+",height="+(h+100)+",location=0,menubar=0,resizable=0,scrollbars=0,status=0");
   newWin.document.write(content);
   newWin.document.write();
   newWin.document.close();
   newWin.focus();
}

var please_wait = null;


function open_url(url, target) {

 	if ( ! document.getElementById) {
  		return false;
 	}

 	if (please_wait != null) {
  		document.getElementById(target).innerHTML = please_wait;
 	}

 	if (window.ActiveXObject) {
  		link = new ActiveXObject("Microsoft.XMLHTTP");
 	} else if (window.XMLHttpRequest) {
  		link = new XMLHttpRequest();
 	}

 	if (link == undefined) {
  		return false;
 	}
 	link.onreadystatechange = function() { response(url, target); }
 	link.open("GET", url, true);
 	link.send(null);
}

function response(url, target) {
 	if (link.readyState == 4) {
	 	document.getElementById(target).innerHTML = (link.status == 200) ? link.responseText : "Ooops!! A broken link! Please contact the webmaster of this website ASAP and give him the fallowing errorcode: " + link.status;
	}
}

function set_loading_message(msg) {
 	please_wait = msg;
}