﻿// Dolphin system 


var win = null;
function OpenPopUpPage(mypage,w,h){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height=' + h + ',width=' + w + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=yes,location=no,menubar=no,resizable=no'
win = window.open(mypage,"myname",settings)
}


function ModalDialog(Url) {
  showModalDialog(Url,window, 'resizable: yes; help: no; status: no; scroll: no;');
}


 function changeScreenSize(w,h)
 {
     window.resizeTo(w,h);
 }
   
   function log_out(){
   
   ht = document.getElementsByTagName("html");
   ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
   if (this.confirm('آيا مطمئن هستيد که مي خواهيد خارج شويد؟'))
   {
       ht[0].style.filter = "";
       close();
   }
   else{
       ht[0].style.filter = "";
       
       }
   }
  
    function keyenter(field,e){
var key;
if (window.event)
   key = window.event.keyCode;

if (key>31)
  if (key<128)
  {
    if (window.event)
      window.event.keyCode=' !"#$%،گ)(×+و-./0123456789:ك,=.؟@ِذ}ىُيلا÷ـ،/’د×؛َءٍف‘{ًْإ~جژچ^_پشذزيثبلاهتنمئدخحضقسفعرصطغظ<|>ّ'.charCodeAt(key-32);
  }
}
  function Add_Bookmark_Favorite(url,title) 
        {
         if (window.sidebar) 
         { // Mozilla Firefox Bookmark
             //Make sure "Load this bookmark in the sidebar is deselected
          window.sidebar.addPanel(title, url,"");
          return false;
         } 
         else if( window.external ) 
         { // IE Favorites
          window.external.AddFavorite( url, title); 
          return false;
         }
         else if(window.opera && window.print) 
         { // Opera Bookmark
                return !addToFav(url,title)
            }
        }
 //-----------------------------------------------------
 //<textarea rows="5" cols="50" onkeyup="return ismaxlength(this,125)"></textarea>  

  function ismaxlength(objTxtCtrl,nLength)
    {
        if (objTxtCtrl.getAttribute && objTxtCtrl.value.length>nLength)
            objTxtCtrl.value=objTxtCtrl.value.substring(0,nLength)
        
        if(document.all)
            document.getElementById('lblCaption').innerText=objTxtCtrl.value.length +' Out Of '+nLength;
        else
            document.getElementById('lblCaption').textContent=objTxtCtrl.value.length +' Out Of '+nLength;
        
    }
