<!--
    var theWaitWindow = null;     // temporarily window while calling a script
        
    function viewpage(url,width,height) {
      options = "toolbar=0,status=0,menubar=0,scrollbars=1," +
                "resizable=1,width=" + width + ",height=" + height ;
       var mywin = window.open(url,"", options);
    }
    
    
    function _JSWait(msg){
  	  var option = "width=400, height=150," +
			 "resizable=yes,"+
			 "menubar=no," +
			 "toolbar=no," +
			 "location=no," +
			 "status=no, " + 
			 "left=80, " +
			 "top=80 ";
  	  var newWin = window.open('/canadmin/pwait.php?msg='+ msg,'waitWin',option);
  	  newWin.focus();
  	  return newWin;
    }
    
    var max_len = 225;
    function count(desc){
       var desc_len = desc.value.length;
       if(desc_len < max_len){
          var cnt_id = document.getElementById("maxchar");
          cnt_id.innerHTML = (max_len - desc_len);
       }else{
          alert("You may only type 255 characters in this box");
          desc.focus();
       }
    }
  
 function select(obj,msg){
          obj.focus();
          obj.select();
          alert(msg);
          return false;
    }
    
    function select_menu(obj,msg){
          obj.focus();
          alert(msg);
          return false;
    }    
    function firstUpper(str){
       var b = str.charAt(0).toUpperCase();
       var b = b + str.slice(1,str.length).toLowerCase();
       return b;
    }
    
 
    function is_valid(obj) {
       var invalid = "!\"#%&\'()$;<=>?[\\]*+,-./:^";
       for(i=0;i <invalid.length;i++){
           if(obj.value.indexOf(invalid.charAt(i)) >= 0){
              return false;
           }
       }
       return true;
    }
    
    function is_digit(obj) { 
      var isValid = 1;
      for(i=0;i<obj.value.length;i++){
        var ch = obj.value.charCodeAt(i);
        isvalid = (ch >= 48 && ch <= 57);
        if(!isValid) return false;
      }
      isvalid = !isNaN(obj.value);
      return isvalid;
    }
  function is_empty(obj) {
        obj.value = L_trim(obj);
        obj.value = R_trim(obj);
      	if ((obj.value.length==0) || (obj.value==null)) {
         return true;
        }else{
           return false;
        }
    }
    
    function is_txtEmpty( txtName ) {
    	var obj = document.getElementById( txtName );
        obj.value = L_trim(obj);
        obj.value = R_trim(obj);
      	if ((obj.value.length==0) || (obj.value==null)) {
         return true;
        }else{
           return false;
        }
    }
    
    function L_trim(obj){
       var hasChar = false;
       var tempObjVlaue = "";
       for(i = 0; i < obj.value.length ; i++){
          cur_char = obj.value.charCodeAt(i);
          if(cur_char != 32)
            hasChar = true;
            
          if(hasChar)
             return obj.value.substr(i);
       }
       return obj.value;
    }
    
    function trimmedValue( txtObjName ) {
    	var obj = document.getElementById( txtObjName );
        obj.value = L_trim(obj);
        obj.value = R_trim(obj);
        
        return obj.value;
    }
    
    function txtBxValuesSame( txtAName, txtBName )
    {
    	var strA = trimmedValue( txtAName );
    	var strB = trimmedValue( txtBName );
    	
    	if ( strA == strB )
    		return true;
    		
    	else
    		return false;
    }
    
    function R_trim(obj){
       var hasChar = false;
       var tempObjVlaue = "";
       var cur_char = "";
       for(i = obj.value.length; i >= 0 ; i--){
          cur_char = obj.value.charCodeAt(i-1);
          if(cur_char != 32)
            hasChar = true;
            
          if(hasChar){
             return obj.value.substr(0,i);
          }   
       }
       return obj.value;
    }
    
    function isValidPhone(phone) {
	   var valid = true;
	   var GoodChars = "0123456789()-+ "
	   var i = 0
	   for (i =0; valid  && i <= phone.value.length -1; i++) {
	      if (GoodChars.indexOf(phone.value.charAt(i)) == -1) {
                valid = false;
	       } 
	   } 
	   return valid; 
    }
    
    function isValidEmail(str) {
       // are regular expressions supported?
       var supported = 0;
       if (window.RegExp) {
    	    var tempStr = "a";
	    var tempReg = new RegExp(tempStr);
	    if (tempReg.test(tempStr)) supported = 1;
       }
       if (!supported) 
          return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
          
       var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
       var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
       return (!r1.test(str) && r2.test(str));
    } 
    
    function _wait_window(){
      if(theWaitWindow != null)
        theWaitWindow.close();
    }
    
    function isValidCategory(obj,newCat,icase){
       var len = obj.options.length;
       for(i = 0; i < len;i++){
          var m_value = obj.options[i].text;
          var new_value = newCat.value;
          if(icase.checked){
             m_value = m_value.toUpperCase();
             new_value = new_value.toUpperCase();
          }
          if(m_value  == new_value){
            obj.options[i].selected = true;
            return  select_menu(obj,new_value + " category already exist");
          }
       }
       return true;
    }

function hov(loc,cls){
   if(loc.className)
      loc.className=cls;
}

    function image_zone(url,width,height) {
      options = "left=650,top=500,screenX=650,screenY=500,toolbar=0,status=0,menubar=0,scrollbars=1," +
                "resizable=1,width=" + width + ",height=" + height ;
       var mywin = window.open('',"imageZone", options);
       mywin.document.open();
       var imageText = "<html><head><title></title></head><body oncontextmenu='return false;'>IranGiftLand.com [<a href='#' onclick='window.close(); return flase;'>Close</a>]<hr /><img width='" + (width-30) + "' src='" + url + "'</body></html>";
       mywin.document.write(imageText);
       mywin.document.close(); 
        var focus = mywin.focus();
        
    }
    
    function recommand_us(url,width,height) {
      options = "left=650,top=500,screenX=650,screenY=500,toolbar=0,status=0,menubar=0,scrollbars=1," +
                "resizable=1,width=" + width + ",height=" + height ;
       var mywin = window.open(url,"imageZone", options);
       mywin.document.open();
       var imageText = "<html><head><title></title></head><body oncontextmenu='return false;'>IranGiftLand.com [<a href='#' onclick='window.close(); return flase;'>Close</a>]<hr /><img width='" + (width-30) + "' src='" + url + "'</body></html>";
       mywin.document.write(imageText);
       mywin.document.close(); 
        var focus = mywin.focus();
        
    }
    
	function popUp(){
  		options = "left=650,top=500,screenX=650,screenY=500,toolbar=0status=0,menubar=0,scrollbars=1," +
                "resizable=1,width=556,height=552";		
		url = "/recommand_us.php";
		window.open(url,"recomand",options)
	}    
        
    
// -->

