var agt=navigator.userAgent.toLowerCase();
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));  



if(is_ie){

  window.fixPNG = function (imgName) { 
    
    var img = new Image();
    img.src = imgName;
    return "<img src='/images/design/null.gif' width='"+img.width+"' height='"+img.height+"' style='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+'"'+img.src+'"'+");') align='absmiddle'/>";
  } 
}else {
  window.fixPNG = function (imgName) { 
    return "<img style='cursor:hand;' src='"+imgName+"' alt='' align='absmiddle'/>";
  }
}


  function showbig(picname){
    picname=picname.substr(0,7) == '/images' ? picname.substr(8) : picname;
    window.open('/includes/foto.php5?pic='+picname,'_blank','scrollbars=yes,taskbar=no,resizeable=no,status=no,menubar=no,top=30,left=30,width=30,height=30');
  }
  
  function showbigpic(picname){
    picname=picname.substr(0,7) == '/images' ? picname.substr(8) : picname;
    window.open('/includes/fotos.php5?pic='+picname,'_blank','scrollbars=yes,taskbar=no,resizeable=no,status=no,menubar=no,top=30,left=30,width=30,height=30');
  }


  function PreLoad(source){
    var NewImage = new Image();
    NewImage.src = source;
  }

  function prepareSubmit(frm){
    var len = frm.all("editbox").length; if (!len) len = 1;
    for (var i=0; i<len; i++)
      frm.all("codebox", i).innerText = frm.all("codebox", i).style.display ? borderOn(frm.all("codebox", i).innerText) : borderOn(frm.all("editbox", i).innerHTML);
  }

 function menuProcess(menuId){
    if(menuId.style.display == 'none'){
     menuId.style.display = 'block';
   }else{
      menuId.style.display = 'none';
   }
 }

 function ge(element){
 	return document.getElementById(element);
 }
 
 $(document).ready(function () { 
 		if($('#pic_on_main'))
 			$('#pic_on_main').html(fixPNG('/images/design/pic_main.png'));
 		$('#logo').html('<a href="/">' + fixPNG('/images/design/logo.png') + '</a>');
 		$('#logo_text').html('<a href="/">' +  fixPNG('/images/design/header.png') + '</a>');
 		$('#footer').html(fixPNG('/images/design/dilers_header.png'));
 		$('a.menu').each(function(){
 			if($(this).hasClass('sel'))
 				imgName = '/images/design/menu_' + $(this).attr("id") + '_sel.png';
 			else
 				imgName = '/images/design/menu_' + $(this).attr("id") + '.png'; 				
 			$(this).html(fixPNG(imgName));
 		});
 	});
 	
 	
function changeType(count, type){
	if($('#plan_' + count).attr('src') == '/images/upload/rooms/'+count+'_'+type+'_small.gif')
		return;
		
	name = navigator.appName; 
	if(navigator.appName ==  'Microsoft Internet Explorer'){
		$('#plan_' + count).attr('src','/images/upload/rooms/'+count+'_'+type+'_small.gif');
		return
	}
	var NewImage = new Image();
	$(NewImage).attr('onload', "$('#plan_" + count + "').attr('src','/images/upload/rooms/"+count+"_"+type+"_small.gif');");

    $(NewImage).attr('src','/images/upload/rooms/'+count+'_'+type+'_small.gif');
	$('#plan_' + count).attr('src','/images/design/load.gif').css('align','absmiddle');
	$('#plan_' + count + '_link').attr('onClick',"tb_show('','/images/upload/rooms/"+count+"_"+type+".gif');").attr('href','/images/upload/rooms/'+count+'_'+type+'.gif');
}


