function newWindow(fileURL,width,height) {
	w = width;
	h = height+110;
	options='width='+w+',height='+h;
	okno=window.open(fileURL,'',options);
}

function showHide(id){
object = document.getElementById(id);

if (object.style.display == "none"){
object.style.display='';
}else{
object.style.display='none';}
}


function SetChecked(val,chkName) {
    dml=document.forms[form];
    len = dml.elements.length;
    var i=0;
    for( i=0 ; i<len ; i++) {
        if(dml.elements[i].disabled!=1){        
            dml.elements[i].checked=val;
        }
    }
}


function popUpImageKill()
	{
		if (typeof(subwin)=='undefined')
			return;
		if (typeof(subwin.closed)=='undefined')
			return;
		if (subwin.closed==true)
			return;
		subwin.close();
	}

function popUpImage(element,width,height)
	{
		popUpImageKill();
		
		href = element.href;
		title = element.getElementsByTagName('img')[0].alt;

		if(!width){width=500;}
		if(!height){height=410;}
		
		swleft = Math.round((self.screen.width - width)/2);
    	swtop  = Math.round((self.screen.height - height)/3);
		
		subwin=window.open("","","height="+height+",width="+width+", left = "+swleft+", top = "+swtop+", toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no");

     	subwin.document.write('<html><head><title>'+title+'</title><style>body{margin:0;padding:0;background:#000 url("img/preloader.gif") no-repeat center;}</style></head>\n');
     	subwin.document.write('<body><img width="'+width+'"height="'+height+'" src="'+href+'" alt="'+title+'" title="" onclick="window.close();"></body>\n');
     	subwin.document.write('</html>\n');

		subwin.focus();
	}


function hideTags(tag,cls){
  var items=this.document.getElementsByTagName(tag)
  for(var i=0;i < items.length;i++){
    if(items[i].className == cls){
     items[i].style.display = "none";
    }
  }
}

function showID(id){
 this.document.getElementById(id).style.display="block";
}

function swapLang(lang){
 hideTags("div","swap");
 showID("swap_"+lang);
 var items=this.document.getElementsByTagName("a")
 for(var i=0;i < items.length;i++){
  items[i].style.border = "0px solid red";
 }
 this.document.getElementById("swap_href_"+lang).style.border="1px solid red";
 return false;
}

