﻿function IsValidDate(box,Object){
	var c=new Array(0,0,0);
	var reg=/\d/;
	var j=0;
	for(i=0;i<box.length;i++){
		hlp=box.charAt(i);
		if(reg.test(hlp))
			c[j]=c[j]*10+parseInt(hlp);
		else if(hlp=='/' || hlp=='-'){
			if(c[j]==0)return false;
			j++;
		}
		else return false;
	}
	if(j>2 || c[2]==0)return false;
	if(c[1]>12)return false;
	if(c[2]>c[0]){
		j=c[0];
		c[0]=c[2];
		c[2]=j;
	}
	c[0]=c[0]%100+1300;
	if(c[1]<6 && c[2]>31)return false;
	if(c[1]>6 && c[2]>30)return false;
	Object.value=c[2]+'/'+c[1]+'/'+c[0];
	return true;
	}
	
function FixPngFiles(){
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
       }
   }
}
}


                function BeginRequestHandler(sender, args)
                {
                
//                if($get("LoadingPanelDIV")!=null) {
////                YahooLoadingPanel.show();
//                }
//                else {
//                var elem=document.createElement("div");
//                elem.setAttribute("id","LoadingPanelDIV");
////                elem.offsetTop=0;
////                elem.offsetLeft=100;
//                elem.innerHTML='<div id="LoadingDiv" style="z-index:9999;border-right: #4b4b6f 1px solid; border-top: #4b4b6f 1px solid; border-left: #4b4b6f 1px solid; width: 192px; border-bottom: #4b4b6f 1px solid; height: 40px; background-color: #fff4d7; text-align: center;">&nbsp;<table cellpadding="0" cellspacing="0" style="width: 100%"><tr><td style="width: 150px">لطفا منتظر بمانید ...</td><td align="right"><img src="./js/spinner.gif" /></td></tr></table></div>';
//                document.body.appendChild(elem);
////                YahooLoadingPanel= new YAHOO.widget.Panel("LoadingPanelDIV");
////                YahooLoadingPanel.cfg.width=192;
////                YahooLoadingPanel.cfg.fixedcenter=true;
////                YahooLoadingPanel.cfg.modal=true;
////                YahooLoadingPanel.cfg.close=false;
////                YahooLoadingPanel.cfg.visible=true;
////                YahooLoadingPanel.show(); }
//}
                }
                function EndRequestHandler(sender, args)
                {
//                     if(YahooLoadingPanel !=null)
//                     YahooLoadingPanel.hide();
                }
               