var first=0	
	
	function onLoadDo()
	{
	

		if (first==0)
		{
	      first=1;     
			for (i=0;i<numOfMsg+1;i++)
			{						    
				if (document.getElementById("link" + i).currentStyle.color=="red")
				{
					document.getElementById("subj" + i).className = "vColor"
					document.getElementById("mark" + i).className = "vMark"
			    }


			}     
		}	
	}
	
  function waitPic(ID,first)
  {
  
  
	//for (i=1;i<document.images.length;i++)
		if (document.all['img'+ID].complete==false)
		{
			setTimeout("waitPic(" + ID + ")",500)
			return;
		}
		
 }

	 function toShowHide(msg,showHide)
	 {
	  document.all['id'+msg].style.display=showHide;
	  return true
	 }
	
	
     function showmsg(msg,frm,frmPrev,no,toMark,fileName,MsgBody)
    { 
    
    //onLoadDo();
    //var picturepath;
    //picturepath="../../forumimg/"+fileName;
    var  picturepath				
    var str
     picturepath="http://www.4ourpets.com/forumimg/"+fileName
     str="<img    name=\"img"+msg+"\" id=\"img"+msg+"\"  src=\""+picturepath+"\" width=250 border=1>"
     //alert(msg)
     //str="here"


   if (fileName.length>4 )
       document.getElementById("span"+msg).innerHTML=str

   if (MsgBody.length>0 )
       document.getElementById("spanbody"+msg).innerHTML=MsgBody
                 
    if(document.all)
                  
      if(document.all['id'+msg].style.display=="block")
      {      
      document.all['id'+msg].style.display="none"      
      if (frm==998 && toMark=="False" )
        location.href="updateReadMsg.asp?msgid="+msg+"&forumPrev="+frmPrev;                      
      }      
      else
      {
           document.all['id'+msg].style.display="block"      				
           //if (fileName.length>4)
           //{
				//document.all['img'+msg].src=picturepath;      
				//setTimeout("waitPic(" + msg + ",true)",500);												
				//document.all['id'+msg].style.display="none"      				
				//setTimeout("toShowHide("+ msg +",'block')",500);												
				
				
				//document.all['id'+msg].style.display="none"      				
			    //setTimeout("showmsg("+msg+","+frm+","+frmPrev+","+no+","+toMark+","+fileName+")",100);												
			    //if (loaded==true)
				//    if (viewedcntr>0)
			//		    setTimeout("waitPic(" + msg + ",true)",100)
			//	    else
			//		   setTimeout("waitPic(" + msg + ",false)",100)		
			//	else
			//			++viewedcntr;
					   													
		   //}	
			//document.all['id'+msg].style.display="block"      				
						
			  
			if (no>=0&&document.getElementById("link" + no).currentStyle.color!="red") 	
			{
				document.getElementById("subj" + no).className = "vColor"		 
				document.getElementById("mark" + no).className = "vMark"		 
			  	document.getElementById("link" + no).click();               
			}
      }
       
  		//document.all['id'+msg].style.display=(document.all['id'+msg].style.display=="block")?"none":"block";
	else
	  //document.getElementById('id'+msg).style.display=(document.getElementById('id'+msg).style.display=="block")?"none":"block";                                           
	  if(document.getElementById('id'+msg).style.display=="block")
	  {
	   document.getElementById('id'+msg).style.display="none"
	   if (frm==998&&toMark=="False")
          location.href="updateReadMsg.asp?msgid="+msg+"&forumPrev="+frmPrev;
                 
	  }	  
	  else
	  {
	    //if (fileName.length>4)
				//document.getElementById('id'+msg).src=picturepath;      
		document.getElementById('id'+msg).style.display="block"
		if (no>0&&document.getElementById("link" + no).currentStyle.color!="red") 	
		{
				document.getElementById("subj" + no).className = "vColor"		 
				document.getElementById("mark" + no).className = "vMark"		 
			  	document.getElementById("link" + no).click();               
		}
	  
	  
	  }	  
	  
	  
	  
   }
   
    function showlay(lay)
    {  
    
    if(document.all)
  	  document.all['id'+lay].style.display=(document.all['id'+lay].style.display=="block")?"none":"block";
	else
	  document.getElementById('id'+lay).style.display=(document.getElementById('id'+lay).style.display=="block")?"none":"block";                                           
   }
   
   
   
   	
var colors=new Array('blue','snow','navy','white','#9090ff','#9090ff','navy','whit','blue');

//===============дъзмъ  printrec===============


function printStr111(str)
{

document.write(str);

}

function  printLine111(color)
{

var str
str="<TABLE cellSpacing=2 cellPadding=0 width=\"100%\" border=0 DIR=RTL align=left><TR>"
str=str+"<TD align=left  bgColor="+color+"></td></TR></TABLE>"  

document.write(str);        

}



function printEmpty111(cellSpacing)
{
var str
str="<tr><td dir=rtl align=left>"     				     
str=str+"<TABLE cellSpacing="+cellSpacing+" cellPadding=0 width=\"100%\" border=0 DIR=RTL align=left><TR>"
str=str+"<TD align=left  bgColor=white></TD></TR></TABLE>"    
str=str+"</td></tr>"
document.write(str);    
   
}


