var newWind = null;
var tmpImage;


 function Msg(myMsg)
	    {
		    alert(myMsg);
	    }
	    function CallPrint(strid)
        {
             var prtContent = document.getElementById(strid);
             var WinPrint = window.open('','','letf=0,top=0,width=612,height=800,toolbar=0,scrollbars=0,status=0');
             WinPrint.document.write(prtContent.innerHTML);
             WinPrint.document.close();
             WinPrint.focus();
             WinPrint.print();
             WinPrint.close();
             
        }
        
function shover(span)
   {
   span.className="spanhover";
   }
   
   function sout(span)
   {
   span.className="spanout";
   }
        
   //not in use     
 function set_bigpic(imgsrc,imgname)
    {
    if (document.getElementById('big_pic').innerHTML=="") //show
    {
    var tbl="";
    tbl="<table cellpadding=0 cellspacing=0 bgcolor=white style='border-bottom: #E8E3DB 1px solid;border-left: #E8E3DB 1px solid;border-right: #E8E3DB 1px solid;border-top: #EFE3DE 1px solid;'>" ;
     tbl=tbl + "<tr class='chartlightblue'><td align=right><img src='img/cancel.gif' height=13  border=0 class='btn' onclick='set_bigpic(this.src);' alt='Close' style='cursor:hand;' /> </td></tr>"
    tbl=tbl + "<tr><td><img height=314 width=445 src='" + imgsrc + "'></img></td></tr>"
     tbl=tbl + "<tr height=20><td align=center class='ImgNameBlue'>" + imgname +"</td></tr>"
    tbl=tbl+"</table>" ;
    document.getElementById('big_pic').innerHTML=tbl;
    
    }
    else //hide
    {
    document.getElementById('big_pic').innerHTML="";
    }
        
    }
    function hide_bigpic()
    {
        
    }
 //current big pic   
function chang_big_pic(img,name)
{

tmpImage = new Image();
    tmpImage.src = img;
    tmp_name=name;	
	var MaxWidth = 450;
	var MaxHeight = 380;
	var reset = false;
	
	var newWidth = null;
	var newHieght = null;
	//alert('w='+tmpImage.width +', h='+ tmpImage.height);
    if (tmpImage.width> MaxWidth || tmpImage.height > MaxHeight)
    {
    
        widthRatio = tmpImage.width / MaxWidth;
        heightRatio = tmpImage.height / MaxHeight;
        ratio = Math.max(widthRatio, heightRatio);
        newWidth = tmpImage.width / ratio;
        newHeight = tmpImage.height / ratio;        
        tmpImage.width = newWidth;
		tmpImage.height = newHeight;
		
    }    
    
    if (document.getElementById('big_pic').innerHTML=="") //show
    {
    var tbl="";
    tbl="<table cellpadding=0 cellspacing=0 bgcolor=white style='border-bottom: #E8E3DB 1px solid;border-left: #E8E3DB 1px solid;border-right: #E8E3DB 1px solid;border-top: #EFE3DE 1px solid;'>" ;
     tbl=tbl + "<tr class='chartlightblue'><td align=right><img src='img/cancel.gif' height=13  border=0 class='btn' onclick='set_bigpic(this.src);' alt='Close' style='cursor:hand;' /> </td></tr>"
    tbl=tbl + "<tr><td><img height='"+tmpImage.height+"' width='"+tmpImage.width+"' src='" + img + "'></img></td></tr>"
     tbl=tbl + "<tr height=20><td align=center class='ImgNameBlue'>" + name +"</td></tr>"
    tbl=tbl+"</table>" ;
    document.getElementById('big_pic').innerHTML=tbl;
    
    }
    else //hide
    {
    document.getElementById('big_pic').innerHTML="";
    } 
    

 
  
   
}
    
    
  
 function hidediv(pass) 
        { 
            var divs = document.getElementById(pass);
            if (document.getElementById) // DOM3 = IE5, NS6 
            {
                divs.style.visibility="hidden";// show/hide 
            
            }
            else 
            if (document.layers) // Netscape 4 
                document.layers[divs].display = 'hidden'; 
            else // IE 4 
                document.all.hideshow.divs.visibility = 'hidden'; 
        } 
        
 function showdiv(pass) 
        { 
            //var divs = document.getElementsByTagName('div'); 
            var divs = document.getElementById(pass);
            if (document.getElementById) // DOM3 = IE5, NS6 
                divs.style.visibility="visible";// show/hide 
            else 
            if (document.layers) // Netscape 4 
                document.layers[divs].display = 'visible'; 
            else // IE 4 
                document.all.hideshow.divs.visibility = 'visible'; 
        } 



//function HandleImageSwap(source,img_name){
// 
//    tmpImage = new Image();
//    tmpImage.src = source;
//    tmp_name=img_name;
//    // document.getElementById('imgListingImage').style.display = "none"
//   	//document.getElementById('imgListingImage').src = tmpImage.src;	
//	var MaxWidth = 305;
//	var MaxHeight = 210;
//	var reset = false;
//	var listingImage = document.getElementById('imgListingImage');
//	var newWidth = null;
//	var newHieght = null;
//	
//    if (tmpImage.width> MaxWidth || tmpImage.height > MaxHeight)
//    {
//        widthRatio = tmpImage.width / MaxWidth;
//        heightRatio = tmpImage.height / MaxHeight;
//        ratio = Math.max(widthRatio, heightRatio);
//        newWidth = tmpImage.width / ratio;
//        newHeight = tmpImage.height / ratio;        
//        tmpImage.width = newWidth;
//		tmpImage.height = newHeight;
//		
//    }        
//    document.getElementById('imgListingImage').style.visibility="hidden";
//    setTimeout('imgDisplay(tmpImage,tmp_name)',100);
//    document.getElementById('imgListingImage').style.visibility="visible";
//   
//	 
//	
//}

//function imgDisplay(img,name)
//{
//    document.getElementById('imgListingImage').src = img.src;
//    document.getElementById('imgListingImage').width=img.width;
//    document.getElementById('imgListingImage').height=img.height;
//    document.getElementById('picname').value=name;
//   
//}





//---------------------------------------------------------------------------------
function chang_img(img,name)
{

tmpImage = new Image();
    tmpImage.src = img;
    tmp_name=name;	
	var MaxWidth = 223;
	var MaxHeight = 162;
	var reset = false;
	//'var listingImage = document.getElementById('imgListingImage');
	var newWidth = null;
	var newHieght = null;
	
    if (tmpImage.width> MaxWidth || tmpImage.height > MaxHeight)
    {
        widthRatio = tmpImage.width / MaxWidth;
        heightRatio = tmpImage.height / MaxHeight;
        ratio = Math.max(widthRatio, heightRatio);
        newWidth = tmpImage.width / ratio;
        newHeight = tmpImage.height / ratio;        
        tmpImage.width = newWidth;
		tmpImage.height = newHeight;
		
    }     
    
//document.getElementById('mainpic').innerHTML='<img src="' + img + '" height="' + tmpImage.height + '" width="' + tmpImage.width + '" /> ';
    //alert("width=" + tmpImage.width + " height=" + tmpImage.height );
    document.getElementById('yossi').style.visibility="hidden";   
    document.getElementById('yossi').src = tmpImage.src;
    
    //document.getElementById('yossi').width=tmpImage.width;
    //document.getElementById('yossi').height=tmpImage.height;
    document.getElementById('yossi').style.visibility="visible";
    //document.getElementById('img_name').innerHTML=name;
   
    document.getElementById('img_name').value=name;
    //img_name.value='123'
  
   
}

