<!--
 function validate_email(e)
 {
  var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
  var returnval=emailfilter.test(e);
  return returnval
 }
//--------------------------------------------------------------------------------------------
 function getposOffset(overlay, offsettype)
 {
  var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
  var parentEl=overlay.offsetParent;
  while (parentEl!=null)
  {
   totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
   parentEl=parentEl.offsetParent;
   }
  return totaloffset;
 }
//--------------------------------------------------------------------------------------------
 function overlayclose(subobj)
 {
  //AnimationCloseOpen(subobj,subobj.offsetWidth,subobj.offsetHeight,subobj.offsetTop,subobj.offsetLeft,"CLOSE",100,"","");
  var curobj=document.getElementById(subobj);
  if (curobj) {curobj.style.display="none";}
 }
//--------------------------------------------------------------------------------------------
 function overlay(curobj, subobjstr, opt_position,message_board,message)
 {
  var xpos,ypos;
  var wPX,hPX,TopPX,LeftPX;
  var subobj=document.getElementById(subobjstr);
  var messageobj=document.getElementById(message_board);

  wPX=300;hPX=100;
 
  if (document.getElementById)
  {
   //subobj.style.display=(subobj.style.display!="block")? "block" : "none";
   
   switch(opt_position)
   {
    case 'CENTERPAGE':
     TopPX=Math.abs((screen.availHeight -hPX) /2);
     LeftPX=Math.abs((screen.availWidth -wPX) /2);
     xpos=LeftPX;
     ypos=TopPX;
     break;

    case 'CENTERWINDOW':
     TopPX=Math.abs( ((screen.availHeight-hPX) /2) + document.body.scrollTop -hPX);
     LeftPX=Math.abs((screen.availWidth -wPX)/2);
     xpos=LeftPX;
     ypos=TopPX;
     break;
     
     case 'bottomleft_460':
      wPX=460;
      xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) ;
      ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0);
      break;

    default:
     if (opt_position.indexOf("mainsize")!=-1)
     {
      wPX=opt_position.substring(9,12);
      hPX=opt_position.substring(13,16);
     }
     xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) ;
     ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0);
     break;
   }

   /*if (opt_position=='CENTERPAGE')
    {
     //subobj.style.left=LeftPX;subobj.style.top=TopPX;
     AnimationCloseOpen(subobj,wPX,hPX,TopPX,LeftPX,"OPEN",0,messageobj,message);
    }
   else
    {
     //subobj.style.left=xpos+"px";subobj.style.top=ypos+"px";
    /// subobj.style.width=0;subobj.style.height=0;
     AnimationCloseOpen(subobj,wPX,hPX,ypos,xpos,"OPEN",0,messageobj,message);
    }
    */
     AnimationCloseOpen(subobj,wPX,hPX,ypos,xpos,"OPEN",0,messageobj,message);
    return true; 
  }
  else
  return false;
 }
//--------------------------------------------------------------------------------------------
 function AnimationCloseOpen(curobj,obj_width,obj_height,obj_top,obj_left,animation_mode,scale,obj_message,message_text)
 {
  var cur_width;
  var cur_height;
  curobj.style.left=obj_left;curobj.style.top=obj_top;

  switch (animation_mode)
  {
   case 'OPEN':
    if (scale<=100)
    {
     curobj.style.display='';
     obj_message.innerHTML='';
     cur_width=(obj_width*scale)/100;
     cur_height=(obj_height*scale)/100;
     curobj.style.width=cur_width;
    // curobj.style.height=cur_height;
     scale=scale+10;
     window.setTimeout(function (){AnimationCloseOpen(curobj,obj_width,obj_height,obj_top,obj_left,animation_mode,scale,obj_message,message_text)},1); 
    }
    else
    {
     curobj.style.display='';
     obj_message.innerHTML=message_text;
    }
    break;

   case 'CLOSE':
   break;
  }
 }
//--------------------------------------------------------------------------------------------
 function Open_Window(URL,WidthPX,HeightPX,WindowProperties)
 {
  wPX=WidthPX;hPX=HeightPX;
  TopPX=Math.abs((screen.availHeight -hPX) /2);
  LeftPX=Math.abs((screen.availWidth -wPX) /2);
  window.open(URL,'_blank','top=' + TopPX + ',left=' + LeftPX + ',' + WindowProperties + ',width=' + wPX + ',height=' + hPX );
 } 
//--------------------------------------------------------------------------------------------
 function OpenAdSampleWindow(URL,WidthPX,HeightPX)
 {
  wPX=WidthPX;hPX=HeightPX;
  TopPX=Math.abs((screen.availHeight -hPX) /2);
  LeftPX=Math.abs((screen.availWidth -wPX) /2);
  window.open(URL,'_blank','top=' + TopPX + ',left=' + LeftPX + ',toolbar=no,location=no,scrollbars=yes,directories=no,status=no,menubar=no,resizeable=no,width=' + wPX + ',height=' + hPX );
 }
//--------------------------------------------------------------------------------------------
 function OpenRateWindow(URL)
 {
  var wPX=250;var hPX=240;
  var TopPX=Math.abs(((screen.availHeight -hPX) /2)-50);
  var LeftPX=Math.abs((screen.availWidth -wPX) /2);
  //window.open(URL,'_blank','top=' + TopPX + ',left=' + LeftPX + ',toolbar=no,location=no,scrollbars=no,directories=no,status=no,menubar=no,resizeable=no,width=' + wPX + ',height=' + hPX );
  var theWin=window.open('','notarget_ratewin','top=' + TopPX + ',left=' + LeftPX + ',toolbar=no,location=no,scrollbars=no,directories=no,status=no,menubar=no,resizeable=no,width=' + wPX + ',height=' + hPX );
  OpenPopUpRateWin.target='notarget_ratewin';
  OpenPopUpRateWin.action=URL;
  OpenPopUpRateWin.submit();
  theWin.focus();
  theWin=null;
 }
//--------------------------------------------------------------------------------------------
 function OpenWindow(URL)
 {
  window.open(URL,'_blank','top=0,left=0,toolbar=no,location=no,scrollbars=yes,directories=no,status=no,menubar=no,resizeable=no,width=550,height=350')
 } 
//--------------------------------------------------------------------------------------------
 function OpenMemberWindow(URL)
 {
  wPX=550;hPX=300;
  TopPX=Math.abs((screen.availHeight -hPX) /2);
  LeftPX=Math.abs((screen.availWidth -wPX) /2);
  //window.open(URL,'_blank','top=' + TopPX + ',left=' + LeftPX + ',toolbar=no,location=no,scrollbars=yes,directories=no,status=no,menubar=no,resizeable=no,width=' + wPX + ',height=' + hPX );
  var theWin=window.open('','notarget_memberwin','top=' + TopPX + ',left=' + LeftPX + ',toolbar=no,location=no,scrollbars=yes,directories=no,status=no,menubar=no,resizeable=no,width=' + wPX + ',height=' + hPX );
  OpenPopUpWin.target='notarget_memberwin';
  OpenPopUpWin.action=URL;
  OpenPopUpWin.submit();
  theWin.focus();
  theWin=null;
 }
//--------------------------------------------------------------------------------------------
 function OpenReasonWindow(URL)
 {
  wPX=400;hPX=200;
  TopPX=Math.abs((screen.availHeight -hPX) /2);
  LeftPX=Math.abs((screen.availWidth -wPX) /2);
  //window.open(URL,'_blank','top=' + TopPX + ',left=' + LeftPX + ',toolbar=no,location=no,scrollbars=yes,directories=no,status=no,menubar=no,resizeable=no,width=' + wPX + ',height=' + hPX );
  var theWin=window.open('','notarget_reasonwin','top=' + TopPX + ',left=' + LeftPX + ',toolbar=no,location=no,scrollbars=yes,directories=no,status=no,menubar=no,resizeable=no,width=' + wPX + ',height=' + hPX );
  OpenPopUpWin.target='notarget_reasonwin';
  OpenPopUpWin.action=URL;
  OpenPopUpWin.submit();
  theWin.focus();
  theWin=null;
 } 
//--------------------------------------------------------------------------------------------
 //0=no, 1=yes
 var copytoclip=1;
 function HighlightAll(theField)
 {
  //var tempval=eval("document."+theField);
  var tempval=document.getElementById(theField);
  if (tempval)
  {
   tempval.focus()
   tempval.select()
   if (document.all&&copytoclip==1)
   {
    therange=tempval.createTextRange()
    therange.execCommand("Copy")
    window.status="Contents highlighted and copied to clipboard!"
    setTimeout("window.status=''",1800)
   }
  } 
 }
//--------------------------------------------------------------------------------------------
 function validate_username(field)
 { 
  var valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-0123456789.~!@#$&*+|;:,?";
  //"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-0123456789." 
  var ok = "yes"; 
  var temp; 
  var field_text;
  if (field.name == "txt_Username") field_text = "Username";
  if (field.name == "txt_Password") field_text = "Password";
  if (field.name == "txt_ConfirmPassword") field_text = "Confirm Password";
  for (var i=0; i<field.value.length; i++)
  { 
   temp = "" + field.value.substring(i, i+1); 
   if (valid.indexOf(temp) == "-1") ok = "no"; 
  } 
  if (ok == "no" && field.value != "") {return false;} else {return true;}
 } 
//--------------------------------------------------------------------------------------------
 function validate_password(field)
 { 
  var valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-0123456789.~!@#$&*+|;:,? ";
  var ok = "yes"; 
  var temp; 
  var field_text;
  if (field.name == "txt_Username") field_text = "Username";
  if (field.name == "txt_Password") field_text = "Password";
  if (field.name == "txt_ConfirmPassword") field_text = "Confirm Password";
  for (var i=0; i<field.value.length; i++)
  { 
   temp = "" + field.value.substring(i, i+1); 
   if (valid.indexOf(temp) == "-1") ok = "no"; 
  } 
  if (ok == "no" && field.value != "") {return false;} else {return true;}
 } 
//--------------------------------------------------------------------------------------------
 function validate_number(field)
 {
  var valid = "0123456789.";
  var ok = "yes"; 
  var temp; 
  for (var i=0; i<field.value.length; i++)
  { 
   temp = "" + field.value.substring(i, i+1); 
   if (valid.indexOf(temp) == "-1") ok = "no"; 
  } 
  if (ok == "no" && field.value != "") {return false;} else {return true;}
 }
//--------------------------------------------------------------------------------------------
 function FormattingNumber(nStr,NumSeperator)
 {
  if (isNaN(nStr)) {return 0};
  nStr += '';
  x = nStr.split('.');
  x_1 = x[0];
  x_2 = x.length > 1 ? '.' + x[1] : '';
  var rgx = /(\d+)(\d{3})/;
  while (rgx.test(x_1)) {x_1 = x_1.replace(rgx, '$1' + ',' + '$2');}
  return x_1 + x_2;
 }
//--------------------------------------------------------------------------------------------
 function format_decimal(pnumber,decimals)
 {
  if (isNaN(pnumber)) {return 0};
  if (pnumber=='') {return 0};
  var snum = new String(pnumber);
  var sec = snum.split('.');
  var whole = parseFloat(sec[0]);
  var result = '';
  if(sec.length > 1)
  {
   var dec = new String(sec[1]);
   dec = String(parseFloat(sec[1])/Math.pow(10,(dec.length - decimals)));
   dec = String(whole + Math.round(parseFloat(dec))/Math.pow(10,decimals));
   var dot = dec.indexOf('.');
   if(dot == -1)
   {
    dec += '.';
    dot = dec.indexOf('.');
   }
    while(dec.length <= dot + decimals) { dec += '0'; }
    result = dec;
   } 
   else
   {
    var dot;
    var dec = new String(whole);
    dec += '.';
    dot = dec.indexOf('.');
    while(dec.length <= dot + decimals) { dec += '0'; }
    result = dec;
   }
   if (decimals==0) result=whole;
  return result;
 }
//--------------------------------------------------------------------------------------------
 function pelk(obj,mode)
 {
  var curobj =  document.getElementById(obj);

  if (mode=='play' || mode==1)
  {
   if (curobj.style.textDecoration=='')
   {
    curobj.style.textDecoration='underline';
   }
   else
   {
    curobj.style.textDecoration='';
   }
   window.setTimeout(function (){pelk(obj,mode)},500); 
  }

  if (mode=='stop' || mode==0)
  {
   window.clearTimeout;
   curobj.style.textDecoration='';
  }
  
  if (mode=='show_hidden' || mode==3)
  {
   if (curobj.style.display=='')
   {
    curobj.style.display='none';
   }
   else
   {
    curobj.style.display='';
   }
   window.setTimeout(function (){pelk(obj,mode)},500); 
  }

  if (mode==4)
  {
   if (curobj.style.color=='#cccccc')
   {
    curobj.style.color='#ff0000';
   }
   else
   {
    curobj.style.color='#cccccc';
   }
   window.setTimeout(function (){pelk(obj,mode)},500); 
  }
  
 }
//--------------------------------------------------------------------------------------------
 function change_link(obj_id,mode)
 {
  var curobj = document.getElementById(obj_id);
  if (curobj)
  {
   if (mode==true) 
    {curobj.style.textDecoration='';curobj.style.color='#ff6600';}
   else
   {curobj.style.textDecoration='';curobj.style.color='';} 
  }
 }
//--------------------------------------------------------------------------------------------
 function AniScroll(x,y)
 {
  var step=20;
  var timeout_scrolling=1;
  var end_process=false,end_process_y=false,end_process_x=false;
  var step_x,step_y;
  if (isNaN(x)==true) x=0;
  if (isNaN(y)==true) y=0;
  var currentY=document.body.scrollTop;
  var currentX=document.body.scrollLeft;
  
  var diff_step_y=Math.abs(currentY-y);
  if (diff_step_y<=500)
   {
    step=Math.round((diff_step_y*step)/500);
    if (step<=1) step=1;
   }

  if (currentY>=y) {step_y=-step;} else {step_y=step;}
  if (end_process_y==false) {currentY=currentY + step_y;}
  window.scroll(currentX,currentY);
  if (currentY==y || (step_y>0 && currentY>=y) || (step_y<0 && currentY<=y) ) {end_process_y=true;}

  if (end_process_y==true)
  {
   if (currentX>=x) {step_x=-step;} else {step_x=step;}
   if (end_process_x==false) {currentX=currentX + step_x;}
   window.scroll(currentX,y);
   if (currentX==x || (step_x>0 && currentX>=x) || (step_x<0 && currentX<=x) ) {end_process_x=true;}
  }

  if (end_process_y==true && end_process_x==true) {end_process=true;}
  if (end_process==false) { window.setTimeout(function (){AniScroll(x,y)},timeout_scrolling); } else {window.clearTimeout}
 } 

 function opensrk()
 {
  wPX=390;hPX=136;
  TopPX=Math.abs((screen.availHeight -hPX) /2) - 250;
  LeftPX=Math.abs((screen.availWidth -wPX) /2) + 200;
  msgWindow=open('srk.asp','srk','top=' + TopPX + ',left=' + LeftPX + ',toolbar=no,location=yes,scrollbars=no,directories=no,status=yes,menubar=no,resizeable=no,width=390,height=136,width=' + wPX + ',height=' + hPX);
  if (msgWindow.opener == null) msgWindow.opener = self;
  msgWindow.focus();
 }
//--------------------------------------------------------------------------------------------
//     Ajax Scripts - SimpleJS ver 0.02 beta
//--------------------------------------------------------------------------------------------
 var enableCache=true;
 var jsCache=new Array();
 var DynObj=new Array();
 function $ajax(_1)
 {
  this.xmlhttp=null;
  this.resetData=function()
  {
   this.method="POST";
   this.queryStringSeparator="?";
   this.argumentSeparator="&";
   this.URLString="";
   this.encodeURIString=true;
   this.execute=false;
   this.element=null;
   this.elementObj=null;
   this.requestFile=_1;
   this.vars=new Object();
   this.responseStatus=new Array(2);
  };
  this.resetFunctions=function()
  {
   this.onLoading=function(){};
   this.onLoaded=function(){};
   this.onInteractive=function(){};
   this.onCompletion=function(){};
   this.onError=function(){};
   this.onFail=function(){};
  };
  this.reset=function()
  {
   this.resetFunctions();
   this.resetData();
  };
  this.crAjx=function() 
  {
   try{this.xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
   catch(e1){try{this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
   catch(e2){this.xmlhttp=null;}
  }

  if(!this.xmlhttp)
  {
   if(typeof XMLHttpRequest!="undefined")
    {this.xmlhttp=new XMLHttpRequest();}
   else
    {this.failed=true;}
  }
 };

 this.setVar=function(_2,_3) {this.vars[_2]=Array(_3,false);};
 this.encVar=function(_4,_5,_6)
 {
  if(true==_6)
   {return Array(encodeURIComponent(_4),encodeURIComponent(_5));}
  else
  {this.vars[encodeURIComponent(_4)]=Array(encodeURIComponent(_5),true);}
 };

 this.processURLString=function(_7,_8)
 {
  encoded=encodeURIComponent(this.argumentSeparator);
  regexp=new RegExp(this.argumentSeparator+"|"+encoded);
  varArray=_7.split(regexp);
  for(i=0;i<varArray.length;i++)
  {
   urlVars=varArray[i].split("=");
   if(true==_8)
    {this.encVar(urlVars[0],urlVars[1]);}
   else
    {this.setVar(urlVars[0],urlVars[1]);}
  }
 };

 this.createURLString=function(_9)
 {
  if(this.encodeURIString&&this.URLString.length){this.processURLString(this.URLString,true);}
  if(_9)
  {
   if(this.URLString.length)
    {this.URLString+=this.argumentSeparator+_9;}
   else
    {this.URLString=_9;}
  }
  this.setVar("rndval",new Date().getTime());
  urlstringtemp=new Array();
  for(key in this.vars)
  {
   if(false==this.vars[key][1]&&true==this.encodeURIString)
   {
    encoded=this.encVar(key,this.vars[key][0],true);
    delete this.vars[key];
    this.vars[encoded[0]]=Array(encoded[1],true);
    key=encoded[0];
   }
   urlstringtemp[urlstringtemp.length]=key+"="+this.vars[key][0];
  }
  if(_9)
   {this.URLString+=this.argumentSeparator+urlstringtemp.join(this.argumentSeparator);}
  else
   {this.URLString+=urlstringtemp.join(this.argumentSeparator);}
 };

 this.runResponse=function() {eval(this.response);};
 
 this.runAJAX=function(_a)
 {
  if(this.failed)
   {this.onFail();}
  else
  {
   this.createURLString(_a);
   if(this.element) {this.elementObj=$(this.element);}
   if(this.xmlhttp)
   {
    var _b=this;
    if(this.method=="GET")
    {
     totalurlstring=this.requestFile+this.queryStringSeparator+this.URLString;
     this.xmlhttp.open(this.method,totalurlstring,true);
    }
    else
    {
     this.xmlhttp.open(this.method,this.requestFile,true);
     try {this.xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");}
     catch(e){}
    }
   this.xmlhttp.onreadystatechange=function()
   {
    switch(_b.xmlhttp.readyState)
    {
     case 1: _b.onLoading();break;
     case 2:_b.onLoaded();break;
     case 3:_b.onInteractive();break;
     case 4:_b.response=_b.xmlhttp.responseText;
           _b.responseXML=_b.xmlhttp.responseXML;
           _b.responseStatus[0]=_b.xmlhttp.status;
           _b.responseStatus[1]=_b.xmlhttp.statusText;
           if(_b.execute) {_b.runResponse();}
           if(_b.elementObj)
           {
            elemNodeName=_b.elementObj.nodeName;
            elemNodeName.toLowerCase();
            if(elemNodeName=="input"||elemNodeName=="select"||elemNodeName=="option"||elemNodeName=="textarea")
             {_b.elementObj.value=_b.response;}
            else
             {_b.elementObj.innerHTML=_b.response;}
            }
            if(_b.responseStatus[0]=="200")
             {_b.onCompletion();}
            else
             {_b.onError();}
            _b.URLString="";
            break;
    }
   };
   this.xmlhttp.send(this.URLString);
   }
  }
 };

 this.reset();
 this.crAjx();
 }

 function ajax_installScript(_c)
 {
  if(!_c) {return;}
  if(window.execScript)
   {window.execScript(_c);}
  else
   {
    if(window.jQuery&&jQuery.browser.safari) {STO(_c,0);} else {STO(_c,0);}
   }
 }
 
 function $ajax_show(_d,_e,_f,_10,_11)
 {
  if(_11=="appear") {$opacity(_d,0,101,600);}
  if(_11=="highlight"){$highlight(_d);}
  var _12=$(_d);
  _12.innerHTML=DynObj[_e].response;
  if(_11=="blind"){$(_d).style.position="";$blinddown(_d);}
  if(enableCache){jsCache[_f]=DynObj[_e].response;}
  DynObj[_e]=false;
  ajax_parseJs(_12);
 }

 function $ajaxreplace(_13,url)
 {
  $opacity(_13,100,0,400);
  $(_13).style.height="";
  scr="$ajaxload('"+_13+"','"+url+"',false,'appear',false)";
  STO(scr,400);
 }
 
 function $ajaxload(_15,url,_17,_18,_19)
 {
  if(_18=="appear"){changeOpac(0,_15);}
  if(_18=="blind")
  {
   var ids=$(_15).style;
   ids.overflow="hidden";
   ids.display="block";
   ids.height="0px";
  }
  if(_19)
  {
   if(enableCache&&jsCache[url])
   {
    if(_18=="appear"){$opacity(_15,0,101,600);}
    if(_18=="highlight"){$highlight(_15);}
    $(_15).innerHTML=jsCache[url];
    if(_18=="blind"){$(_15).style.position="";$blinddown(_15);}
    return;
   }
  }
  var _1b=DynObj.length;
  if(_17!=false){$(_15).innerHTML=_17;}
  DynObj[_1b]=new $ajax();
  DynObj[_1b].requestFile=url;
  DynObj[_1b].onCompletion=function(){$ajax_show(_15,_1b,url,_17,_18);};
  DynObj[_1b].runAJAX();
 }
 
 function ajax_parseJs(obj)
 {
  var _1d=obj.getElementsByTagName("SCRIPT");
  var _1e="";
  var _1f="";
  for(var no=0;no<_1d.length;no++)
  {
   if(_1d[no].src)
   {
    var _21=document.getElementsByTagName("head")[0];
    var _22=document.createElement("script");
    _22.setAttribute("type","text/javascript");
    _22.setAttribute("src",_1d[no].src);
   }
   else
   {
    if (typeof(DHTMLSuite) != "undefined")
     {if(DHTMLSuite.clientInfoObj.isOpera){_1f=_1f+_1d[no].text+"\n";}}
    else
     {_1f=_1f+_1d[no].innerHTML;}
   }
  }
 if(_1f) {ajax_installScript(_1f);}
 }

 function $(id) 
 {
  return document.getElementById(id);
 }

 function STO(_24,_25)
 {
  return window.setTimeout(_24,_25);
 }
 
 function DecToHexa(_26)
 {
  var _27=parseInt(_26).toString(16);
  if(_26<16) {_27="0"+_27;}
  return _27;
 }

 function addslashes(str)
 {
  str=str.replace(/\"/g,"\\\"");
  str=str.replace(/\'/g,"\\'");
  return str;
 }
 
 function $toggle(id)
 {
  if(act_height(id)==0) 
   {$blinddown(id);}
  else
   {$blindup(id);}
 }

 function act_height(id)
 {
  height=$(id).clientHeight;
  if(height==0) {height=$(id).offsetHeight;}
  return height;
 }
  
 function act_width(id)
 {
  width=$(id).clientWidth;
  if(width==0) {width=$(id).offsetWidth;}
  return width;
 }

 function max_height(id)
 {
  var ids=$(id).style;
  ids.overflow="hidden";
  if(act_height(id)!=0)
   {return act_height(id);}
  else
  {
   origdisp=ids.display;
   origheight=ids.height;
   origpos=ids.position;
   origvis=ids.visibility;
   ids.visibility="hidden";
   ids.height="";
   ids.display="block";
   ids.position="absolute";
   height=act_height(id);
   ids.display=origdisp;
   ids.height=origheight;
   ids.position=origpos;
   ids.visibility=origvis;
   return height;
  }
 }

 function $blindup(id,_2f)
 {
  if(!_2f){_2f=200;}
  acth=act_height(id);
  maxh=max_height(id);
  if(acth==maxh)
  {
   $(id).style.display="block";
   var _30;
   _30=Math.ceil(_2f/acth);
   for(i=0;i<=acth;i++)
   {
    newh=acth-i;
    STO("$('"+id+"').style.height='"+newh+"px'",_30*i);
   }
  }
 }

 function $blinddown(id,_32)
 {
  if(!_32) {_32=200;}
  acth=act_height(id);
  if(acth==0)
  {
   maxh=max_height(id);
   $(id).style.display="block";
   $(id).style.height="0px";
   var _33;
   _33=Math.ceil(_32/maxh);
   for(i=1;i<=maxh;i++) {STO("$('"+id+"').style.height='"+i+"px'",_33*i);}
  }
 }
 
 function $opacity(id,_35,_36,_37)
 {
  if($(id).style.width==0){$(id).style.width=act_width(id);}
  var _38=Math.round(_37/100);
  var _39=0;
  if(_35>_36)
  {
   for(i=_35;i>=_36;i--)
   {
    STO("changeOpac("+i+",'"+id+"')",(_39*_38));
    _39++;
   }
  }
  else
  {
   if(_35<_36)
   {
    for(i=_35;i<=_36;i++)
    {
     STO("changeOpac("+i+",'"+id+"')",(_39*_38));
    _39++;
    }
   }
  }
 }
 
 function changeOpac(_3a,id)
 {
  var ids=$(id).style;
  ids.opacity=(_3a/100);
  ids.MozOpacity=(_3a/100);
  ids.KhtmlOpacity=(_3a/100);
  ids.filter="alpha(opacity="+_3a+")";
 }
 
 function $shiftOpacity(id,_3e)
 {
  if($(id).style.opacity<0.5)
   {$opacity(id,0,100,_3e);}
  else
   {$opacity(id,100,0,_3e);}
 }
 
 function currentOpac(id,_40,_41)
 {
  var _42=100;
  if($(id).style.opacity<100) {_42=$(id).style.opacity*100;}
  $opacity(id,_42,_40,_41);
 }
 
 function $highlight(id,_44,_45,_46)
 {
  if(_44) {milli=_44;} else {milli=900;}
  if(_45) {endcol=_45;} else {endcol="#FFFFFF";}
  if(_46) {origcol=_46;} else {origcol="#FFFFA6";}
  $colorize(origcol,endcol,id,milli,"high");
 }
 
 function $textColor(id,_48,_49,_4a)
 {
  if(_4a){milli=_4a;} else {milli=900;}
  $colorize(_48,_49,id,milli,"text");
 }
 
 function $morphColor(id,_4c,_4d,_4e,_4f,_50,_51,_52)
 {
  if(_52){milli=_52;} else {milli=900;}
  $colorize(_4c,_4d,id,milli,"text");
  $colorize(_4e,_4f,id,milli,"back");
  if(_50!=false) {$colorize(_50,_51,id,milli,"border");}
 }
 
 function $colorize(_53,end,id,_56,_57)
 {
  dr=parseInt(_53.substring(1,3),16);
  dg=parseInt(_53.substring(3,5),16);
  db=parseInt(_53.substring(5,7),16);
  fr=parseInt(end.substring(1,3),16);
  fg=parseInt(end.substring(3,5),16);
  fb=parseInt(end.substring(5,7),16);
  steps=_56/10;
  cr=dr;
  cg=dg;
  cb=db;
  sr=(fr-dr)/steps;
  sg=(fg-dg)/steps;
  sb=(fb-db)/steps;
  var zzi=10;
  for(var x=0;x<steps;x++)
  {
   color="#"+DecToHexa(cr)+DecToHexa(cg)+DecToHexa(cb);
   if(x==(steps-1))
   {
    if(_57=="high"){color="";}else{color=end;}
   }
   mytime=(x);
   if(_57=="back"||_57=="high") 
    {newfonc="$(\""+id+"\").style.backgroundColor=\""+color+"\";";}
   else
   {
    if(_57=="text") 
     {newfonc="$(\""+id+"\").style.color=\""+color+"\";";}
    else
     { if(_57=="border") {newfonc="$(\""+id+"\").style.borderColor=\""+color+"\";";} }
   }
   STO(newfonc,zzi);
   cr+=sr;
   cg+=sg;
   cb+=sb;
   zzi+=10;
  }
 }

 //callAjax is used for the Basic Ajax functions
 function callAjax(divId, target, loader, effect)
 {
  ecache = false;
  $ajaxload(divId, target, loader, effect, ecache);
 }
 
 function eventRequest(funcName)
 {
  els = document.getElementsByTagName('input', 'textarea');
  var vals="";
  for(x=els.length-1; x>=0; x--) {vals += '&'+escape(els[x].id)+'='+escape(els[x].value);}
  els = document.getElementsByTagName('div');
  for(x=els.length-1; x>=0; x--){vals+= '&'+escape(els[x].id)+'='+escape(els[x].innerHTML);}
  new Ajax.Request('/index.php', {parameters:'phpFunc='+funcName+vals, onSuccess:handlerFunc, onFailure:errFunc});
 }

 //handlerFunc and errFunc are used by Ajax.Request
 var handlerFunc = function(t)
 {
  json= eval(t.getResponseHeader('X-JSON'));
  //alert(t.getResponseHeader('X-JSON'));
  eval(json.js);
  //alert(t.responseText);
 }
 
 var errFunc = function(t)
 {
  alert('Error ' + t.status + ' -- ' + t.statusText);
 }
//--------------------------------------------------------------------------------------------
 function AddToFriendList(yid)
 {
  var add_to_list="ymsgr:addfriend?" + yid;
  window.open(add_to_list,'_self'); 
 }

 function SendIM(yid)
 {
  var add_to_list="ymsgr:addfriend?" + yid;
  window.open(add_to_list,'_self'); 
 }
//--------------------------------------------------------------------------------------------
 function IsAjax()
 {
  var xmlHttp=null;
  xmlHttp=new XMLHttpRequest();
  if (xmlHttp==null)
  {
   xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
   if (xmlHttp==null)
   {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
  }
  
  if (xmlHttp==null) {return false;} else {return true;}
 }

//--------------------------------------------------------------------------------------------
 function loop_section(section_name,loop_time,PAGE_NAME)
 {
  switch (section_name.toUpperCase())
  {
   case 'STATINFO_TABLE':
    callAjax( "contentdiv_statinfotable" , "command.asp?cmd=loop_statinfotable&var=" + PAGE_NAME, "" , "" )
   break;
   
   case 'STATISTIC_TABLE_TODAY':
    callAjax( "contentdiv_statistictable" , "statistic.asp?type=cmd&" + PAGE_NAME, "" , "" )
   break;
  }
  window.setTimeout(function (){loop_section(section_name,loop_time,PAGE_NAME)},loop_time*1000); 
 }
//--------------------------------------------------------------------------------------------
 function spLoginTable(el)
 {
   if (el.txtName.value=='') {alert ('.\u0646\u0627\u0645 \u06A9\u0627\u0631\u0628\u0631\u064A \u062E\u0648\u062F \u0631\u0627 \u0648\u0627\u0631\u062F \u0646\u0645\u0627\u064A\u064A\u062F');el.txtName.focus(); return false;}
   if (el.txtPName.value=='') {alert ('.\u06A9\u0644\u0645\u0647 \u0639\u0628\u0648\u0631 \u062E\u0648\u062F \u0631\u0627 \u0648\u0627\u0631\u062F \u0646\u0645\u0627\u064A\u064A\u062F'); el.txtPName.focus(); return false;}
   if (el.txtARENDI.value=='') {alert ('.\u06A9\u062F \u0627\u0645\u0646\u064A\u062A\u064A \u0631\u0627 \u0648\u0627\u0631\u062F \u0646\u0645\u0627\u064A\u064A\u062F'); el.txtARENDI.focus(); return false;}
  return true;
 }
//--------------------------------------------------------------------------------------------
 function LoadLoginTable(obj,c_arendi,img_arendi,redirect_url)
 {
  var strLoginTableDetails;
  var ajax_url="login.asp?type=cmd&HTTP_REFERER=" + redirect_url + "&ARENDI=" + c_arendi;
  
  document.getElementById('LoginTableForm').innerHTML="<DIV align='right' dir='rtl' id='LoginTable' style='cursor:move;position:absolute; display:none; border: 1px solid #84837a;font-size:11px;font-family:tahoma;color:#000000; background-color:#f8f4cb ; padding: 4px;'>" +
                "<a href='javascript:overlayclose(\u0022LoginTable\u0022)'>" +
                "<img src='images/icoCancel.gif' border='0' style='HEIGHT:16px;WIDTH:16px' dir='ltr' title='Close | &#1576;&#1587;&#1578;&#1606; &#1662;&#1606;&#1580;&#1585;&#1607;'>" +
                "</a>" +
                "<div id='LoginTableMessage'></div>" +
                "</DIV>";

  var theRootLoginTable = document.getElementById("LoginTable");
  Drag.init(theRootLoginTable, null, 0, window.screen.width-430, 0,null);
                 
  strLoginTableDetails="<form action='/Login.asp' method='GET' name='Login' id='Login' target='_self' onsubmit='return spLoginTable(this);' language='javascript' style='margin:0px;padding:0px;width:300'>" +
                       "<input type='hidden' name='ARENDI'  value='" + c_arendi + "'>" + 
                       "<input type='hidden' value='Fa' name='PageLan'>" +
                       "<div align='center' style='padding:0px'>" +
                       "<center>" +
                       "<table dir='ltr' border='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='100%' >" +
                       "<tr>" +
                       "<td align='right' width=''>" +
                       "</td>" +
                       "<td align='right' width='195'>" +
                       "<input name='txtName' id='txtName' value='' class='input' style='width:190px' tabindex='1' maxlength='60' onclick='this.focus();this.select();' >" +
                       "</td>" +
                       "<td dir='rtl' align='right' width='74' height='20'>" +
                       "<font face='Tahoma' style='font-size: 11px' color='#D2E9FF'><span id='strID'>&#1606;&#1575;&#1605; &#1705;&#1575;&#1585;&#1576;&#1585;&#1610;:</span></font>" +
                       "</td>" +
                       "</tr>" +
                       "<tr>" +
                       "<td align='right'>" +
                       "<a href='javascript:opensrk();'>" +
                       "<img dir='ltr'  border='0' style ='margin:0px;padding:0px' src='images/srk2.gif' alt#='Virtual Keyboard | &#1589;&#1601;&#1581;&#1607; &#1705;&#1604;&#1610;&#1583; &#1605;&#1580;&#1575;&#1586;&#1740;' title='Virtual Keyboard | &#1589;&#1601;&#1581;&#1607; &#1705;&#1604;&#1610;&#1583; &#1605;&#1580;&#1575;&#1586;&#1740;' height='20' style='margin:0px;padding:0px'>" +
                       "</a>" +
                       "</td>" +
                       "<td align='right' height='20'>" +
                       "<input type='password' name='txtPName' id='txtPName' class='input' style='width:190px' tabindex='2' maxlength='60' onclick='this.focus();this.select();'>" +
                       "</td>" +
                       "<td dir='rtl' align='right'>" +
                       "<font face='Tahoma' style='font-size: 11px' color='#D2E9FF'>&#1705;&#1604;&#1605;&#1607; &#1593;&#1576;&#1608;&#1585;:</font>" +
                       "</td>" +
                       "</tr>" +
                       "<tr>" +
                       "<td align='right' dir='ltr' colspan='2' height='20'>" +
                       img_arendi +
                       "&nbsp;&nbsp;&nbsp;" +
                       "<input type='text'  name='txtARENDI' id='txtARENDI' class='input' style='width:86px;' tabindex='3' maxlength='6' onclick='this.focus();this.select();'>" +
                       "</td>" +
                       "<td dir='rtl' align='right'>" +
                       "</td>" +
                       "</tr>" +
                       "<tr>" +
                       "<td>" +
                       "</td>" +
                       "<td align='right' height='20'>" +
                       "<input type='button' onclick=\u0022 javascript:RunAjaxLoginTable('" + ajax_url + "') \u0022 value='&#1608;&#1585;&#1608;&#1583;' name='cmdEnter' class='button' style='float:right;width:85px' tabindex='4'>" +
                       "</td>" +
                       "<td ></td>" +
                       "</tr>" +
                       "<tr>" +
                       "<td height='1' colspan='3' align='right' valign='top' style=''>" +
                       "</td>" +
                       "</tr>" +
                       "</table>" +
                       "<div align='center' style='color:#ff0000;direction:rtl;padding:4px 20px 4px 20px' id='contentdiv_tagerror'>&nbsp;</div>" +
                       "</center></div></form>";


  //strLoginTableDetails=strLoginTableDetails.replace("'","\'");
  //strLoginTableDetails=strLoginTableDetails.replace('"','\u0022');
  overlay(obj, 'LoginTable', 'bottomleft','LoginTableMessage',strLoginTableDetails);
 }
//--------------------------------------------------------------------------------------------
 function RunAjaxLoginTable(redirect_url)
 {
  redirect_url= redirect_url + "&mode=MEMBER_LOGIN" + 
                               "&txtName=" + document.getElementById('txtName').value +
                               "&txtPName=" + document.getElementById('txtPName').value +
                               "&txtARENDI=" + document.getElementById('txtARENDI').value;
  if (spLoginTable(document.forms['Login'])==true) 
  {
   callAjax('contentdiv_tagerror',redirect_url,'&#1583;&#1585; &#1581;&#1575;&#1604; &#1608;&#1585;&#1608;&#1583;...',''); 
  }
 }
//--------------------------------------------------------------------------------------------
 function ShowTimerLable(interval,value)
 {
  var tmpLable,H,M,S,strH,strM,strS;
  S=value % 60;
  M=format_decimal(value/60,0);
  if (M>=60) 
  {
   H=format_decimal(M/60,0);
   M=M % 60;
  }
  else
  {H=0;}
  if (!S || isNaN(S)==true) {S=0;}
  if (!M || isNaN(M)==true) {M=0;}
  if (!H || isNaN(H)==true) {H=0;}
  if (String(S).length==1) {strS="0" + S;} else {strS=S;}
  if (String(M).length==1) {strM="0" + M;} else {strM=M;}
  if (String(H).length==1) {strH="0" + H;} else {strH=H;}
  tmpLable=strH + ":" + strM + ":" + strS;
  return tmpLable;
 }
//--------------------------------------------------------------------------------------------
 function AniTimerFormat(value,id,id2)
 {
  var obj= document.getElementById(id);
  var obj2= document.getElementById(id2);
  value--;
  if (value>0)
   {
    window.setTimeout(function (){AniTimerFormat(value,id,id2)},1000);
    if (obj) {obj.innerHTML=ShowTimerLable("s",value)};
    //return ShowTimerLable("s",value);
   }
  else
   {
    window.clearTimeout;
    if (obj2) {obj2.innerHTML="<span style='color:#33cc33'>&#1587;&#1610;&#1587;&#1578;&#1605; &#1601;&#1593;&#1575;&#1604; &#1575;&#1587;&#1578;.</span>"};
   } 
 }
//--------------------------------------------------------------------------------------------
 function resize_image(e,img_id,img_src,size,action,img_style,border_style,mode,img_title)
 {
  if (img_src=='') {return false;}
  var e_id=e;
  e=document.getElementById(e);
  e_img=document.getElementById(img_id);
  mode=mode.toUpperCase();
  var h,w,str,tag_img,tag_border1,tag_border2,w_size,h_size,arr_size;
  var obj_img,str_resize;
  var return_x,return_y;
  //str=w + "x" + h;
  
  tag_border1="<table id='border_" + e_id + "' border='0' cellspacing='0' cellpadding='0'>" +
              "<tr>" +
              "<td " + border_style + ">";
  tag_border2="</td></tr></table>";
  
  switch (action.toUpperCase())
  {
   case 'FIXED_WIDTH':
    if (mode=='DRAW')
    {
     tag_img="<img onerror=\u0022javascript:this.style.display='none';document.getElementById('border_" + e_id + "').style.display='none';\u0022 src='" + img_src +"' " + img_style + " width='" + size + "' dir='rtl' title='" + img_title + "'>";
     str=tag_border1+tag_img+tag_border2;
     //document.write (str);
     if (e_img) {e_img.innerHTML=str;}     
    }
    else
     {e.style.width=size;}
   break;

   case 'FIXED_HEIGHT':
    if (mode=='DRAW')
    {
     tag_img="<img onerror=\u0022javascript:this.style.display='none';document.getElementById('border_" + e_id + "').style.display='none';\u0022 src='" + img_src +"' " + img_style + " height='" + size + "' dir='rtl' title='" + img_title + "'>";
     str=tag_border1+tag_img+tag_border2;
     //document.write (str);
     if (e_img) {e_img.innerHTML=str;}
    }
    else
     {e.style.height=size;}
   break;

   case 'FIXED':
    arr_size=size.split('x');
    w_size=arr_size[0];
    h_size=arr_size[1];
    
    if (mode=='DRAW')
    {
     tag_img="<img onerror=\u0022javascript:this.style.display='none';document.getElementById('border_" + e_id + "').style.display='none';\u0022 src='" + img_src +"' " + img_style + " width='" + w_size + "' height='" + h_size + "' dir='rtl' title='" + img_title + "'>";
     str=tag_border1+tag_img+tag_border2;
     //document.write (str);
     if (e_img) {e_img.innerHTML=str;}
    }
    else
     {e.style.height=size;}
   break;

   case 'RESIZE':
    if (mode=='DRAW' || mode=='RETURN' || mode=='RETURN_X')
    {
     arr_size=size.split('x');
     w_size=arr_size[0];
     h_size=arr_size[1];

     obj_img=new Image();
     obj_img.src=img_src;
     w=obj_img.width;
     h=obj_img.height;
     obj_img=null;
     
     if (w!=0 && h!=0)
     {
      if (w>=h)
      {str_resize="width='" + w_size +"'";return_x=w;}
      else
      {str_resize="height='" + h_size +"'";return_x=h;}
      if (w_size>w && h_size>h) {str_resize="";return_x=w;}
      tag_img="<img onerror=\u0022javascript:this.style.display='none';document.getElementById('border_" + e_id + "').style.display='none';\u0022 id='"+e_id+"' " + str_resize + " src='" + img_src +"' " + img_style + " dir='rtl' title='" + img_title + "'>";
     } 
     else
     {
      str_resize="width='" + w_size +"'";return_x=w_size;
      border_style=border_style.replace(/'/g,"\u005C\u0027");
      img_style=img_style.replace(/'/g,"\u005C\u0027");
      //tag_img="<img onerror=\u0022javascript:this.style.display='none'\u0022 id='"+e_id+"' onload=\u0022javascript:resize_image('"+e_id+"','"+img_src+"','"+size+"','"+action+"','"+img_style+"','"+border_style+"','DO','"+img_title+"')\u0022 " + str_resize + " src='" + img_src +"' " + img_style + " dir='rtl' title='" + img_title + "'>";

      str_resize="width='" + w_size +"'";
      tag_img="<img onerror=\u0022javascript:this.style.display='none';document.getElementById('border_" + e_id + "').style.display='none';\u0022 id='"+e_id+"' " + str_resize + " src='" + img_src +"' " + img_style + " dir='rtl' title='" + img_title + "'>";
     }
     
     str=tag_border1+tag_img+tag_border2;
     
     switch (mode)
     {
      case 'DRAW'     : if (e_img) {e_img.innerHTML=str;};break; //document.write (str);break;
      case 'RETURN'   : return str;break;
      case 'RETURN_X' : return return_x;break;
     }
    }
    else
     {
      /*
      arr_size=size.split('x');
      w_size=arr_size[0];
      h_size=arr_size[1];
      
      w=e.width;
      h=e.height;
      if (w>=h)
      {e.style.width=w_size;}
      else
      {e.style.height=h_size;}
      */
     }
     
   break;

  }
 } 
//--------------------------------------------------------------------------------------------
 function Command(cmd) 
 {
  var str;
  var someWin;
  switch (cmd) 
  {
   case "Upload":
    var theWin=openWin('notarget_upload', '', 400, 150, true, false);
    OpenPopUpWin.submit();
    theWin.focus();
    theWin=null;
    break;

   case "PreviewAdEmail":
    updateRTE('txt_HTMLCode');
    var theWin=openWin('notarget_previewademail', '', 800, 620, true, true);
    Payment.target="notarget_previewademail"; 
    Payment.action="/PreviewAdEmail_.asp" 
    Payment.submit();
    theWin.focus();
    theWin=null;
    break;

  }
 }
//--------------------------------------------------------------------------------------------
 function openWin(winName, urlLoc, w, h, showStatus, isViewer)
 {
		l = (screen.availWidth - w)/2;
		t = (screen.availHeight - h)/2;
		features  = "toolbar=no";      // yes|no 
		features += ",location=no";    // yes|no 
		features += ",directories=no"; // yes|no 
		features += ",status=" + (showStatus?"yes":"no");  // yes|no 
		features += ",menubar=no";     // yes|no 
		features += ",scrollbars=" + (isViewer?"yes":"no");   // auto|yes|no 
		features += ",resizable=" + (isViewer?"yes":"no");   // yes|no 
		features += ",dependent";      // close the parent, close the popup, omit if you want otherwise 
		features += ",height=" + h;
		features += ",width=" + w;
		features += ",left=" + l;
		features += ",top=" + t;
		winName = winName.replace(/[^a-z]/gi,"_");
		return window.open(urlLoc,winName,features);
 } 
//--------------------------------------------------------------------------------------------
 function top_menu(menu_id,action)
 {
  var obj_menu=document.getElementById(menu_id);
  if (obj_menu)
  {
  
   switch (action.toUpperCase())
   {
    case 'OVER':
     obj_menu.style.backgroundImage="url('')";
     obj_menu.style.backgroundColor='#D8D8D8';
    break;

    case 'OUT':
     obj_menu.style.backgroundImage="url('/images/top_menu_back.gif')";
     obj_menu.style.backgroundColor='#F3F3F3';
    break;
   }
  }
 }
//----------------------------------
function loading()
{
 var w=220;
 var h=100;
 document.getElementById('loading').innerHTML="<div id='div_loading' align='center' style='position:absolute;width:220px;height:100px;'><div dir=rtl align=center style='font-size:11px;background-color:#f8f4cb;border: 1px solid #84837a;padding:10px 10px 10px 10px'>&#1583;&#1585; &#1581;&#1575;&#1604; &#1576;&#1575;&#1585;&#1711;&#1584;&#1575;&#1585;&#1610; &#1575;&#1591;&#1604;&#1575;&#1593;&#1575;&#1578;. &#1604;&#1591;&#1601;&#1575;&#1611; &#1589;&#1576;&#1585; &#1705;&#1606;&#1610;&#1583;...<br><img src=/images/ajax.gif></div></div>";
 document.getElementById('div_loading').style.top=Math.abs( ((screen.availHeight-h) /2) + document.body.scrollTop -h);
 document.getElementById('div_loading').style.left= Math.abs((screen.availWidth -w)/2);
}
//----------------------------------
function cmd(url,content)
{
 loading();
 callAjax(content,url,"","");
}
//----------------------------------

//-->