

function hideshow(divid)
{
	if(divid == 'divWebsite')
	{
		document.getElementById('div_Website').style.display='';
		document.getElementById('div_show').style.display='none';
		document.getElementById('div_hide').style.display='';
		}
	if(divid == 'divWebsitehide')
	{
		document.getElementById('div_Website').style.display='none';
		document.getElementById('div_hide').style.display='none';
		document.getElementById('div_show').style.display='';
	}
}

function fck(url)
{
	var j=window.open(url,"jj","left=200, top=100,width=630,height=530,scrollbars=0" )
}

function delete_unit(url)
{
	var r=confirm("Are you sure, you want to delete this unit?");
	if (r==true)
  	{
		window.location.href=url;
	}
}

function openWin5(url)
{
	var j=window.open(url,"jj","left=400, top=400,width=330,height=250,scrollbars=0")
}

function openWin3(url)
{
	var j=window.open(url,"jj","left=200, top=100, width=660,height=520,scrollbars=0")
}
function openWinPayment(url)
{
	var j=window.open(url,"jj","left=200, top=150, width=400,height=220,scrollbars=0,status=0,titlebar=0,toolbar=0")
}
function openWinEnlarge(url,width,height)
{	
	var j=window.open(url,"jj","left=200, top=100, width="+width+",height="+height+",scrollbars=0")
}

function openWin1(url)
{
	var j=window.open(url,"jj","width=480,height=200,scrollbars=0")
}

function openWin2(url)
{
	var j=window.open(url,"jj","left=20, top=20, width=430,height=413,scrollbars=0") 
}

function openWin4(url)
{
	var j=window.open(url,"jj","left=20, top=20, width=530,height=630,scrollbars=0,resizable=1") 
}
function openWinInvoic(url)
{
	var j=window.open(url,"jj","left=20, top=20, width=1000,height=700,scrollbars=0,resizable=1") 
}
function popup(mylink, windowname)
{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	   href=mylink;
	else
	   href=mylink.href;
	window.open(href, windowname, ',type=fullWindow,fullscreen,scrollbars=yes');
	return false;
}
function Invoice(url)
{
var j=window.open(url,"jj","left=20, top=20, width=1010,height=730,scrollbars=1") 
}
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{

   var arVersion = navigator.appVersion.split("MSIE")

   var version = parseFloat(arVersion[1])

   if ((version >= 5.5) && (document.body.filters)) 

   {

      for(var i=0; i<document.images.length; i++)

      {

         var img = document.images[i]

         var imgName = img.src.toUpperCase()

         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")

         {

            var imgID = (img.id) ? "id='" + img.id + "' " : ""

            var imgClass = (img.className) ? "class='" + img.className + "' " : ""

            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "

            var imgStyle = "display:inline-block;" + img.style.cssText 

            if (img.align == "left") imgStyle = "float:left;" + imgStyle

            if (img.align == "right") imgStyle = "float:right;" + imgStyle

            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle

            var strNewHTML = "<span " + imgID + imgClass + imgTitle

            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"

            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"

            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 

            img.outerHTML = strNewHTML

            i = i-1

                                    

         }

      }

   }   

   

}

 

if (window.attachEvent)
{
	 window.attachEvent("onload", correctPNG);
	 window.attachEvent("onunload", correctPNG);
}
else
{
 window.addEventListener("DOMContentLoaded", correctPNG, false);
 window.addEventListener("unload", correctPNG, false);
}



function Change()
{
	if(document.getElementById("dd2").selectedIndex==1)
	{
		document.form1.action="rented_units.php";
		document.form1.submit();
	}
}

function Changem()
{
	if(document.getElementById("dd2m").selectedIndex==1)
	{
		document.form1.action="rented_units_manager.php";
		document.form1.submit();
	}
}

function Change1(url)
{
	window.location.href=url;
}

function Change1m(url)
{
		if(document.getElementById("ddlm").selectedIndex==1)
		{
			document.form1.action="available_units_manager.php";
			document.form1.submit();
		}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function Photo(url)
{
	//alert(url);
	var j=window.open("","jj","top=60, left=130,width=191,height=124,scrollbars=no,resizable=yes,titlebar=no,menubar=no,toolbar=no,locationbar=no,location=no,status=no")
	with (j.document)
	{
		open();
		writeln ('<html><head><title>Photo</title></head><body topMargin="1" leftMargin="1" marginwidth="1" marginheight="1" onload="var imgHeight=document.all.xyz.height;var imgWidth=document.all.xyz.width; window.resizeTo((imgWidth+12),(imgHeight+31));return true;" marginwidth=1 marginheight=1 topmargin=0 leftmargin=0>');			
		writeln ('<center><img border="0" name="xyz" src='+ url +'></center>');					
		close();
	}
}

function paging(PagStep)
{
	document.frm.pagingStep.value	=	PagStep;
	document.frm.submit();
}

function sorting(orderBy,mode)
{
	document.frm.orderBy.value	=	orderBy;
	document.frm.mode.value		=	mode;
	document.frm.submit();
}
