
function fix_height(tar){
 
 var tar=document.getElementById(tar);
 var tar2=tar.getElementsByTagName("td");
 var maxheight=0;
 for(i=0;i<tar2.length;i++){
	 if(tar2[i].offsetHeight > maxheight) maxheight= tar2[i].offsetHeight;
  }
 for(i=0;i<tar2.length;i++){
	 tar2[i].style.height=maxheight+"px";
  }
}

function start_screen(id){
	
	
  check_screen(id);
  
   if(((jQuery.browser.version=='8.0' || jQuery.browser.version=='7.0') && jQuery.browser.msie==true ) || jQuery.browser.opera==true){
     setInterval("check_screen('"+id+"')",100);
	
    }
   $(window).resize(
   function(){check_screen(id);}
   )
	
}


function check_screen(id){

  if(typeof id!="object"){
	var obj=$("#"+id);  
  }else if(typeof id=="undefined"){
	var obj=$("body");
  }else obj=id;
 var temp_width=0;
 var obj_offset=obj.offset();

  var left=Math.ceil(obj.css("paddingLeft").split("px")[0]);
 var right=Math.ceil(obj.css("paddingRight").split("px")[0]);  


 if((obj_offset.left ==0 ||obj_offset.left ==2 )&& $("body").width() <= obj.width()){

	return false; 
 }else if( $("body").width() <= obj.width() ){
	obj.css({
	 left:"0px",
	 marginLeft:"0px" 
	});
	 
 }
 
 
 else{ 
	 
  if(obj_offset.left < 0) temp_width=0-obj_offset.left;


  obj.css({
	 left:"50%",
	 marginLeft:"-"+((obj.width()/2)-temp_width+left)+"px" 
	});
  
  
  return false;
	 
	 
 }


}


var check_obj=new Array();
var check_name=new Array();

function check_this(obj){
	
 var master;
 var master_obj=document.getElementById(obj.id+"_title");
 var master_obj2=document.getElementById(obj.id+"_title_send");
 var save_obj=document.getElementById("save_obj");
 if(save_obj==null){
	var newobj=document.createElement("input");
	newobj.type="hidden";
	newobj.id="save_obj";
	newobj.name="save_obj";
	obj.parentNode.appendChild(newobj);
	var save_obj=document.getElementById("save_obj");
 }
 
 if(obj.className.match("save")!=null){
   save_obj.value=save_obj.value+"//"+encodeURIComponent(obj.id);  
 }
 
 if(obj.className.match("must")==null) return;
 
 if(typeof obj=="undefined"){
	 alert("Object can't find");
     return;
 }
 if(obj.id==""){
	obj.id=obj.name;
	if(obj.id==""){
	 alert("Object can't find");
     return;
	}
 }
    check_obj.push(obj.id);
	
    if(master_obj==null){
	    master="";
	}else if(typeof master_obj.childNodes=="undefined"){
	   	master="";
	}else master=master_obj.childNodes[0].nodeValue;
	
	check_name.push(master);
	
	if(master_obj2==null){
		var newobj=document.createElement("input");
		newobj.id=obj.id+"_title_send";
		newobj.name=obj.id+"_title_send";
		newobj.value=master;
		newobj.type="hidden";
		obj.parentNode.appendChild(newobj);
	}
	
} 

function dis(id){
	var obj=document.getElementById(id);
    if(obj!=null) obj.disabled=false;
}


function clear_a(){
 
 $("a").attr('onFocus','if(this.blur)this.blur()');
 
}

function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=900,height=100,screenX=0,screenY=0,top=0,left=0')
}  
 

function change_function_one(obj_pic){


 var _obj=$(".change");
 for(i=0;i<_obj.length;i++){
	 
	var temp=$(_obj[i]).find("img");
	if(temp.length==0) continue;
    if($(temp[0]).attr("src").match(obj_pic)){
			    $(_obj[i]).addClass("no_change_2");
	}
 }
}

function change_function(){

 var _obj=$(".change");

 var str=window.location.href.replace("?","");
 str=str.replace(/&language\=[^&]*/,"");

 for(i=0;i<_obj.length;i++){
	var temp=$(_obj[i]).find("img");
	if(temp.length==0) continue;
	
	if($(_obj[i]).attr("class").match("no_change_2")){
    $(temp[0]).attr("src",$(temp[0]).attr("src").replace(".png","-c.png"));
	continue;		
	}
	
    var str2=$(_obj[i]).attr("href").replace("?","");

	if($(temp[0]).attr("src").match("-c.png")=="-c.png" ){

	if(str.match(str2)==str2 ){

    $(temp[0]).attr("src",$(temp[0]).attr("src").replace("-c.png",".png"));
	continue;
	}
	$(temp[0]).hover(
		function(){
			$(this).attr("src",$(this).attr("src").replace("-c.png",".png"))	;
			
		},function(){
			$(this).attr("src",$(this).attr("src").replace(".png","-c.png"))	;
		}
					 
					 )
	}else{
		
	if((str.match(str2)==str2 && str2!="" ) ){
	
		str3=str.match(/[0-9]*$/,"");
		str4=str2.match(/[0-9]*$/,"");
		
		if(Math.ceil(str3)!=Math.ceil(str4)){
				$(temp[0]).hover(
		function(){
			$(this).attr("src",$(this).attr("src").replace(".png","-c.png"))	;
			
		},function(){
			$(this).attr("src",$(this).attr("src").replace("-c.png",".png"))	;
		}
					 
					 )
				continue;
		}
    $(temp[0]).attr("src",$(temp[0]).attr("src").replace(".png","-c.png"));
	continue;
	}		
	$(temp[0]).hover(
		function(){
			$(this).attr("src",$(this).attr("src").replace(".png","-c.png"))	;
			
		},function(){
			$(this).attr("src",$(this).attr("src").replace("-c.png",".png"))	;
		}
					 
					 )		
		
		
		
	}

 }


}


