String.prototype.Trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"");}
String.prototype.Ltrim = function(){return this.replace(/(^\s*)/g, "");}
String.prototype.Rtrim = function(){return this.replace(/(\s*$)/g, "");}

function showdom(url,width,height)
      {
         var s_ret=new String() ;
       s_ret=window.showModalDialog(url,"","help:0;dialogHeight:"+height+"px;status:0;dialogWidth:"+width+"px");
      }
	  
	  
function showmess(url,width,height)
      {
		 //screen.height
		 //screen.width
         var s_ret=new String() ;
       s_ret=window.showModelessDialog(url,"","help:0;dialogHeight:'"+height+"px';status:0;dialogWidth:'"+width+"'px");
      }    
	  
	  
function openwindow(url,width,height,left,top)
      {     
       window.open(url,"","width="+width+"px,height="+height+"px,toolbar=no,resizable=no,directories=no,Status=no,scrollbars=auto,menubar=no,fullscreen=no,left="+left+"px,top="+top+"px");      
      }
	  
	  
function showdiv(width,height,left,top,content,objectid)
{
  // var divwidth = screen.width/2 - 300;
  // var divheight = screen.height/2 - 260;
   var str  = "<div id='alert' style='BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX: 102; LEFT:"+left+"; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: "+width+"; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP:"+top+";HEIGHT:"+height+"; FILTER: Alpha(opacity=85);'>";
     str += content;
	 //  str += "<table height='36' cellSpacing='0' cellPadding='0' width='100%' bgColor='#ffffff' border='0'>";
//	   str += "<tr>";
//	   str += "<td width='100%' height='15' background='../images/hell.gif' colspan='2'>"+title+"</td>";
//	   str += "<td><IMG onclick=\"javascript:myclose()\" height='14' src='../images/Icon.gif' width='16' onmouseover=\"javascript:this.src='../images/Icon2.gif'\" onmouseout=\"this.src='../images/Icon.gif'\" border='0'>";
//	   str += "</td>";
//	   str += "</tr>"
//	   str += "<tr><td width='1%'><img src='../images/icon_big_info.gif'></td><td height='80' colspan='2'>";
//	   str += "<div>"+content+"</div>";
//	   str += "</td></tr>";
//	   str += "<tr><td colSpan='3'><div align='center'><input type='button' value='È·¶¨' onclick=\"javascript:myclose()\" class='btn'></div></td></tr>"
//	   str += "<tr><td colSpan='3' height='20' background='../images/hell.gif'>";
//	   str += "</td></tr></table></div>";
       str += "</div>";
	  //alert(str);
    document.getElementById(objectid).innerHTML = str;	 
      
}

function printdoc(){
 var WebBrowser = '<OBJECT ID="WebBrowserBO" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
	  WebBrowserBO.ExecWB(7, 1)
	  //document.parent.frames('bumenfrm').WebBrowser.ExecWB(7,1)
	  //document.all.WebBrowser.ExecWB(7,1)
}

function   getFileSize ()   
 {   
          
          window.oldOnError   =   window.onerror;   
          window.onerror   =   function   (err)   {   
              if   (err.indexOf('utomation')   !=   -1)  
               {   
                  alert('file   access   not   possible');   
                  return   true;   
              }   
              else     
                  return   false;   
          };   
          var files = document.all;
          var filesize = 0;
          var   fso   =   new   ActiveXObject('Scripting.FileSystemObject');   
          for(var i = 0 ; i < files.length;i ++)
          {
            if (files[i].type=="file")
            {
            var   file   =   fso.GetFile(files[i].value);   
            filesize += file.Size;
            window.onerror   =   window.oldOnError;   
            }
          }
          alert(filesize);             
}

var xmlHttp;
function createXMLHttpRequest() {
    if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    else if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();
    }
}  
function post(url,funname)
{
	createXMLHttpRequest();		
    xmlHttp.onreadystatechange = funname;
    xmlHttp.open("GET", url,true);
    xmlHttp.send(null);
}
function showflash(width,height,flashsrc)
{	
	var str = "";
	str += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'">';
	str += '<param name="wmode" value="transparent">';
    str += "<param name='movie' value="+flashsrc+">";
    str += '<param name="quality" value="high">'
    str += '<embed src="'+flashsrc+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>';
    str += '</object>';
	document.write(str);
}


