function Validator(frmname)
{
  this.formobj=document.forms[frmname];
    if(!this.formobj)
    {
      alert("BUG: couldnot get Form object "+frmname);
        return;
    }
    if(this.formobj.onsubmit)
    {
     this.formobj.old_onsubmit = this.formobj.onsubmit;
     this.formobj.onsubmit=null;
    }
    else
    {
     this.formobj.old_onsubmit = null;
    }
    this.formobj.onsubmit=form_submit_handler;
    this.addValidation = add_validation;
    this.setAddnlValidationFunction=set_addnl_vfunction;
    this.clearAllValidations = clear_all_validations;
}
function set_addnl_vfunction(functionname)
{
  this.formobj.addnlvalidation = functionname;
}
function clear_all_validations()
{
    for(var itr=0;itr < this.formobj.elements.length;itr++)
    {
        this.formobj.elements[itr].validationset = null;
    }
}
function form_submit_handler()
{
    for(var itr=0;itr < this.elements.length;itr++)
    {
        if(this.elements[itr].validationset &&
       !this.elements[itr].validationset.validate())
        {
          return false;
        }
    }
    if(this.addnlvalidation)
    {
      str =" var ret = "+this.addnlvalidation+"()";
      eval(str);
    if(!ret) return ret;
    }
    return true;
}
function add_validation(itemname,descriptor,errstr)
{
  if(!this.formobj)
    {
      alert("BUG: the form object is not set properly");
        return;
    }//if
    var itemobj = this.formobj[itemname];
  if(!itemobj)
    {
      alert("BUG: Couldnot get the input object named: "+itemname);
        return;
    }
    if(!itemobj.validationset)
    {
      itemobj.validationset = new ValidationSet(itemobj);
    }
  itemobj.validationset.add(descriptor,errstr);
}
function ValidationDesc(inputitem,desc,error)
{
      this.desc=desc;
    this.error=error;
    this.itemobj = inputitem;
    this.validate=vdesc_validate;
}
function vdesc_validate()
{
 if(!V2validateData(this.desc,this.itemobj,this.error))
 {
    this.itemobj.focus();
        return false;
 }
 return true;
}
function ValidationSet(inputitem)
{
    this.vSet=new Array();
    this.add= add_validationdesc;
    this.validate= vset_validate;
    this.itemobj = inputitem;
}
function add_validationdesc(desc,error)
{
  this.vSet[this.vSet.length]= 
      new ValidationDesc(this.itemobj,desc,error);
}
function vset_validate()
{
   for(var itr=0;itr<this.vSet.length;itr++)
     {
       if(!this.vSet[itr].validate())
         {
           return false;
         }
     }
     return true;
}
function validateEmailv2(email)
{
// a very simple email validation checking. 
// you can add more complex email checking if it helps 
    if(email.length <= 0)
    {
      return true;
    }
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    {
      var regexp_user=/^\"?[\w-_\.]*\"?$/;
      if(splitted[1].match(regexp_user) == null) return false;
    }
    if(splitted[2] != null)
    {
      var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
      if(splitted[2].match(regexp_domain) == null) 
      {
        var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
        if(splitted[2].match(regexp_ip) == null) return false;
      }// if
      return true;
    }
return false;
}
function trim(inputString) {
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
    while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function

function V2validateData(strValidateStr,objValue,strError) 
{ 
    var epos = strValidateStr.search("="); 
    var  command  = ""; 
    var  cmdvalue = ""; 
    if(epos >= 0) 
    { 
     command  = strValidateStr.substring(0,epos); 
     cmdvalue = strValidateStr.substr(epos+1); 
    } 
    else 
    { 
     command = strValidateStr; 
    } 
    switch(command) 
    { 
        case "req": 
        case "required": 
         { 
           if(eval(trim(objValue.value.length)) == 0 || trim(objValue.value) == "") 
           { 
              if(!strError || strError.length ==0) 
              { 
                strError = objValue.name + " : Required Field"; 
              }//if 
              alert(strError); 
              return false; 
           }//if 
           break;             
         }//case required 
        case "maxlength": 
        case "maxlen": 
          { 
             if(eval(objValue.value.length) >  eval(cmdvalue)) 
             { 
               if(!strError || strError.length ==0) 
               { 
                 strError = objValue.name + " : "+cmdvalue+" characters maximum "; 
               }//if 
               //alert(strError + "\n[Current length = " + objValue.value.length + " ]"); 
                alert(strError); 
               return false; 
             }//if 
             break; 
          }//case maxlen 
        case "minlength": 
        case "minlen": 
           { 
             if(eval(objValue.value.length) <  eval(cmdvalue)) 
             { 
               if(!strError || strError.length ==0) 
               { 
                 strError = objValue.name + " : " + cmdvalue + " characters minimum  "; 
               }//if               
               alert(strError + "\n[Current length = " + objValue.value.length + " ]"); 
               return false;                 
             }//if 
             break; 
            }//case minlen 
        case "alnum": 
        case "alphanumeric": 
           { 
              var charpos = objValue.value.search("[^A-Za-z0-9]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
               if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name +": Only alpha-numeric characters allowed "; 
                }//if 
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//case alphanumeric 
           case "alphanumeric1": 
           { 
              var charpos = objValue.value.search("[^A-Za-z0-9 ]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
               if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name +": Only alpha-numeric characters allowed "; 
                }//if 
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//case alphanumeric1
        case "num": 
        case "numeric": 
           { 
              var charpos = objValue.value.search("[^0-9]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name +": Only digits allowed "; 
                }//if               
               // alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break;               
           }//numeric 
        case "alphabetic": 
        case "alpha": 
           { 
              var charpos = objValue.value.search("[^A-Za-z\]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name+": Only alphabetic characters allowed "; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//alpha 
        case "alnumhyphen":
            {
              var charpos = objValue.value.search("[^A-Za-z0-9\-'_ ]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name+": characters allowed are A-Z,a-z,0-9,- and _"; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if             
            break;
            }
        case "alhyphen":
            {
              var charpos = objValue.value.search("[^A-Za-z-_./' ]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name+": characters allowed are A-Z,a-z,-,/,., ,' and _"; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if             
            break;
            }    
        case "email": 
          { 
               if(!validateEmailv2(objValue.value)) 
               { 
                 if(!strError || strError.length ==0) 
                 { 
                    strError = objValue.name+": Enter a valid Email address "; 
                 }//if                                               
                 alert(strError); 
                 return false; 
               }//if 
           break; 
          }//case email 
        case "lt": 
        case "lessthan": 
         { 
            if(isNaN(objValue.value)) 
            { 
              alert(objValue.name+": Should be a number "); 
              return false; 
            }//if 
            if(eval(objValue.value) >=  eval(cmdvalue)) 
            { 
              if(!strError || strError.length ==0) 
              { 
                strError = objValue.name + " : value should be less than "+ cmdvalue; 
              }//if               
              alert(strError); 
              return false;                 
             }//if             
            break; 
         }//case lessthan 
        case "gt": 
        case "greaterthan": 
         { 
            if(isNaN(objValue.value)) 
            { 
              alert(objValue.name+": Should be a number "); 
              return false; 
            }//if 
             if(eval(objValue.value) <=  eval(cmdvalue)) 
             { 
               if(!strError || strError.length ==0) 
               { 
                 strError = objValue.name + " : value should be greater than "+ cmdvalue; 
               }//if               
               alert(strError);
               return false;                 
             }//if             
            break; 
         }//case greaterthan 
        case "regexp": 
         { 
             if(objValue.value.length > 0)
            {
                if(!objValue.value.match(cmdvalue)) 
                { 
                  if(!strError || strError.length ==0) 
                  { 
                    strError = objValue.name+": Invalid characters found "; 
                  }//if                                                               
                  alert(strError); 
                  return false;                   
                }//if 
            }
           break; 
         }//case regexp 
        case "dontselect": 
         { 
            if(objValue.selectedIndex == null) 
            { 
              alert("BUG: dontselect command for non-select Item"); 
              return false; 
            } 
            if(objValue.selectedIndex == eval(cmdvalue)) 
            { 
             if(!strError || strError.length ==0) 
              { 
              strError = objValue.name+": Please Select one option "; 
              }//if                                                               
              alert(strError); 
              return false;                                   
             } 
             break; 
         }//case dontselect 
        case "area": 
         { 
           if(eval(objValue.value.length) == 0) 
           { 
              if(!strError || strError.length ==0) 
              { 
                strError = objValue.name + " : Required Field"; 
              }//if 
              alert(strError); 
              return false; 
           }//if 
           break;             
         }//case area 
         
           case "alpha1": 
           { 
              var charpos = objValue.value.search("[^A-Za-z[\t]\_\'\&\,]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name+": Only alphabetic characters allowed "; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//alpha1 
           
            case "alpha2": 
           { 
              var charpos = objValue.value.search("[^A-Za-z[\t]]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.name+": Only alphabetic characters allowed "; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//alpha2 
           
           case "chk": 
           { 
                 if(objValue.checked)
                    return true;
                 else
                 {
                       if(!strError || strError.length ==0) 
                       { 
                            strError = objValue.name + " : Required Field"; 
                        } 
                                  
                    alert(strError);
                    return false;
                 }
                 break;  

            }//chk

         
         
    }//switch 
    
    return true; 
}

function addimageEntry() 
{
  var newid= document.getElementById("tblimage");

  var x=newid.insertRow(newid.rows.length)
     
  var a=x.insertCell(0)
  var b=x.insertCell(1)
  var c=x.insertCell(2)
 

  x.align="center";
  a.innerHTML='<input type="hidden" name="image_id[]" value="-1">Images : ';
  b.innerHTML="  <input name=\"txtImages[]\" type=\"file\" size=\"27\"  class=\"textbox\" value=\"\" />";
  c.innerHTML="<a href=\"#\" onclick=\"removerowElement(this);\"><img src=\"images/fwrong_icon.gif\" alt=\"X\" width=\"14\" height=\"14\" /></a>";

  x.appendChild(a);
  x.appendChild(b);
  x.appendChild(c);

}
function removerowElement(r)
{
    
  var i=r.parentNode.parentNode.rowIndex 
  
  if(confirm("Do you really want to delete") == true){
    document.getElementById('tblimage').deleteRow(i)
    return true;
  }

}
function removeImage(r)
{

var i=r.parentNode.parentNode.rowIndex
  
   if(confirm("Do you really want to delete") == true){
    document.getElementById('imagetbl').deleteRow(i)
    return true;
  }
}

function removeImage_new(r,fldname)
{
	var i=r.parentNode.parentNode.rowIndex
  
	   document.getElementById(fldname).value='1';
    document.getElementById('imagetbl').deleteRow(i)
	
    return true;
  
}
function removeImage1(r)
{

var i=r.parentNode.parentNode.rowIndex
  
   if(confirm("Do you really want to delete") == true){
	   document.getElementById('fakedelete').value='delete';
	   document.frmaddcbi.submit(); 
    document.getElementById('imagetbl').deleteRow(i)
	
    return true;
  }
}

function removeImage2(r)
{

var i=r.parentNode.parentNode.rowIndex
  
   if(confirm("Do you really want to delete") == true){
	   document.getElementById('originaldelete').value='delete';
	   document.frmaddcbi.submit(); 
    document.getElementById('imagetbl').deleteRow(i)
		
	  return true;
  }
}

function decide_action()
 { 
     if(check_buttons()==true) 
        { 
            if(document.frm1.payment[0].checked==true) 
            { 
                document.frm1.action="process.php"; 
            }
            else if(document.frm1.payment[1].checked==true) 
            { 
                alert(1);
                document.frm1.action="DoDirectPaymentReceipt.php"; 
            } 
             
        }
     document.frm1.submit();
 }

function check_buttons() { var ok=false; for(i=0; i<2; i++) { if(document.frm1.payment[i].checked==true) { ok=true; } } if(ok==false) { alert("Select at least one Payment option."); } return ok; }

function MergeBrands()
{
    var i, cnt, sitems, len;
    
    cnt = document.forms[0].chkBrands.length;
    sitems = "";
    len = 0
    for(i = 0; i < cnt; i++)
    {
        if(document.forms[0].chkBrands[i].checked == true)
        {
            sitems += document.forms[0].chkBrands[i].value+",";
            len++;
        }
        
    }
    
    if(len == 0)
    {
        alert('Please Select the Brands to be Merged');
        return false;    
    }
    
    if(len == 1)
    {
        alert('Please Select atleast two brands to merge');
        return false;    
    }
   
    sitems = sitems.substring(0,sitems.length-2);

    if(document.forms[0].txtBrand.value == '')
    {
        alert('Please enter the BrandName to Merge');
        return false;
    }
    res = window.confirm("Are you sure you want to Merge these '"+sitems+"'  brands into '"+document.forms[0].txtBrand.value+"' ");
    
    return res;
        
}

function checkfield(id) 
{
    obj = document.getElementById(id);
    if (obj.value == '(Optional)') 
        obj.value='';
    
}
function changetext(id)
{
    obj = document.getElementById(id);
    if (obj.value == '') 
        obj.value = '(Optional)';
        
}

function showdiv()
{
    document.getElementById('subaccounts').style.display='block';          
}

function showsubdivs(id)
{
    if(id.value == 0)
        document.getElementById('subdiv1').style.display='none';          
    else
        document.getElementById('subdiv1').style.display='block';          
}

function ToggleAllQuestions(bShow) 
{
    var DivList = Array();
    var Show = '';
    
    if(bShow == false) 
        Show = "none"; 
    else
        Show = "block";
  
    if (document.getElementsByTagName) 
        var DivList = document.getElementsByTagName("div");
  
    else if (document.all.tags) 
         var DivList = document.all.tags("div");
  
    for(i=0; i<DivList.length; i++) 
    {
        if(DivList[i].id.substr(0,8) == 'div_ans_') 
           DivList[i].style.display = Show;
    }
}

function ToggleLayer(oLayer) 
{
  if (document.getElementById) 
  {
    var LayerStyle = document.getElementById(oLayer).style;
    LayerStyle.display = LayerStyle.display? "" : "none";
  }
  else if (document.all) 
  {
    var LayerStyle = document.all[oLayer].style;
    LayerStyle.display = LayerStyle.display? "" : "none";
  }
  else if (document.layers) 
  {
    var LayerStyle = document.layers[oLayer].style;
    LayerStyle.display = LayerStyle.display? "" : "none";
  }
  if(document.getElementById(oLayer+'_stat')) 
  {
     var bShow = false;
     if(LayerStyle.display == "") { bShow = true; }
  }
}


function checkstate(chkname)
{
	if(document.frmCounterfeitReport.selall.checked==1)
	{
		checkall("frmCounterfeitReport",chkname,1);
		
	}
	if(document.frmCounterfeitReport.selall.checked==0)
	{
		checkall("frmCounterfeitReport",chkname,0);
	}
}

function checkall(FormName, FieldName, CheckValue)
{
	if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;


	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
	else
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue;
}

function checkval(chkname1)
{
	var allchkbox=document.forms['frmCounterfeitReport'].elements[chkname1];
	var countallchkbox = allchkbox.length;
	for(var i = 0; i < countallchkbox; i++)
		{
			if(allchkbox[i].checked == 0)
			{
			document.frmCounterfeitReport.selall.checked=0;
			}

		}

}

function validate_wvalues(){
	if(document.frmWatchValues.sltModelType.value == 0){
		alert("Please Select Brand Name");
		return false;
	}else if(document.frmWatchValues.sltModels.value == 0){
	    alert("Please Select Model Name");
		return false;
	}
	return true;
}
function validate_wvalues_new(){
    if(document.frmWatchValues.sltModelType.value == 0){
        alert("Please Select Brand Name");
        return false;
    }
    else if(document.frmWatchValues.sltModels.value == 0){
    if(document.frmWatchValues.txtModelno.value == 0 )
    {
        alert("Please Select Either Model Name OR Model Number");
        return false;
    }
    }
    return true;
}
function submitfrm(){
 document.frmMreport.sltLogin.value=0;
 document.frmMreport.submit();
}
// JavaScript Document
//////////////////////////////////////////////////////////////////////////////////////
function check_val(frmName,chkname1)
{
  
    //var allchkbox=document.forms[frmName].elements[chkname1];
    var allchkbox=document.getElementsByName(chkname1);
    var countallchkbox = allchkbox.length;
    var    test    =    "1";
    
    for(var i = 0; i < countallchkbox; i++)
        {

            if(allchkbox[i].checked == 0){
                test    =    0;        
                
            document.getElementById('selval1').style.display='none';
            document.getElementById('selval').style.display='block';}
            
        }
        
        if(test    ==    "1"){
            
            document.getElementById('selval').style.display='none';
            document.getElementById('selval1').style.display='block';
        }
}    
function check_state(frmName,chkname)
{
    
    if(document.forms[frmName].selall.checked==1)
    {
        check_all(frmName,chkname,1);
        
    }
    if(document.forms[frmName].selall.checked==0)
    {
        check_all(frmName,chkname,0);
    }
}    
function check_state1(frmName,chkname)
{
    
        check_all(frmName,chkname,1);
    
}    
function check_all(FormName, FieldName, CheckValue)
{
    if(CheckValue    ==    1){
        document.getElementById('selval').style.display='none';
        document.getElementById('selval1').style.display='block';
    }else{
        document.getElementById('selval1').style.display='none';
        document.getElementById('selval').style.display='block';
    }
    if(!document.forms[FormName])
        return;
    var objCheckBoxes = document.forms[FormName].elements[FieldName];
    if(!objCheckBoxes)
        return;
    var countCheckBoxes = objCheckBoxes.length;
    if(!countCheckBoxes)
        objCheckBoxes.checked = CheckValue;
    else
        // set the check value for all check boxes
        for(var i = 0; i < countCheckBoxes; i++)
            objCheckBoxes[i].checked = CheckValue;
}
function checkexport(frmName,chkname1)
{
    var allchkbox=document.forms[frmName].elements[chkname1];
    var countallchkbox = allchkbox.length;
        if(countallchkbox== undefined){
          var tt=document.forms[frmName].elements[chkname1].checked;
           if(!tt){
            alert("Please Select One");
            return false;
           }
           else{
            document.forms[frmName].submit();
           }
        }
       else{
    var    test    =    "";        
    for(var i = 0; i < countallchkbox; i++)
      {
          if(allchkbox[i].checked == true){
              
              test    =    test+allchkbox[i].value+",";
          }
      }
      if(test){
        //
                document.forms[frmName].submit();
                return true; 
      }else{
          alert("Please Select One");
                  return false;
      }
       }
}

function OpenPopup(url) 
{
    newwindow = window.open(url,'name','height=360,width=360');
    if (window.focus) 
        newwindow.focus()
    return false;
}
function validateAdminFile()
{
	if(document.excelFileUpload.uploadedfile.value.lastIndexOf(".xls")==-1) {
      alert("Please upload only excel file");
      return false;
	}
}
function updatevaliduser(id,st)
{
 var res= confirm("Are you sure renew the account i.e update validation date");
 if(res == true)
 {
  if(st == "j")
    location.href='japanesevaliduseraccounts.php?id='+id+'&flag=update';
   else if(st == "d")
    location.href='dataagevaliduseraccounts.php?id='+id+'&flag=update';
  else
    location.href='validuseraccounts.php?id='+id+'&flag=update';
 }
}
function sameadd(f,street1,street2,cityv,statev,zipv,countryv)
{

if(f.asb.checked == true)
{
    f.address1.value = street1;
    f.address2.value = street2;
    f.city.value = cityv;
    f.zip.value = zipv;
    sel = f.state;    
    for (i=0; i<sel.options.length; i++) {
        if (sel.options[i].value == statev) {
            sel.selectedIndex = i;
        }
    }
    sel2 = f.country;    
    for (i=0; i<sel2.options.length; i++) {
        if (sel2.options[i].value == countryv) {
            sel2.selectedIndex = i;
        }
    }

}
else
{
    f.address1.value = '';
    f.address2.value = '';
    f.city.value = '';
    f.zip.value = '';
    f.state.selectedIndex =0;
    f.country.selectedIndex =0;
}
}
function selindex(sel,selvalue)
{                                
  for (i=0; i<sel.options.length; i++) {
        if (sel.options[i].value == selvalue) {
            sel.selectedIndex = i;
        }
    }
}

function redirect_popup(ff)
{
var  item_number = ff;
//alert(item_number);
//document.getElementbyId(model).display=none;
Popup.hide('modal1');
  window.location.href='cbnew_report.php?ebay=' + item_number;
}

function redirect_popup2(ff)
{
var  rep_number = ff;
//alert(item_number);
//document.getElementbyId(model).display=none;
Popup.hide('modal1');
  window.location.href='vrcbnew_report.php?repnum=' + rep_number;
}

function redirect_popup3(ff)
{
var  rep_number = ff;
//alert(item_number);
//document.getElementbyId(model).display=none;
Popup.hide('modal1');
  window.location.href='vrreport.php?repnum=' + rep_number;
}

//header("Location: vrcb_report.php?hdnSearch=counterfeit&t=".$timestamp."");
function redirect_popup4(ff)
{
var  rep_number = ff;
//alert(item_number);
//document.getElementbyId(model).display=none;
  Popup.hide('modal1');
  window.location.href='vrcb_report.php?hdnSearch=counterfeit&repnum=' + rep_number;
}


function serverFunction(url)
{
	
	 var req = false;
	 // For Safari, Firefox, and other non-MS browsers
	 if (window.XMLHttpRequest) {
		  try {
			  
			   req = new XMLHttpRequest();
		  } catch (e) {
			   req = false;
		  }
	 } else if (window.ActiveXObject) {
		  // For Internet Explorer on Windows
		  try {
			   req = new ActiveXObject("Msxml2.XMLHTTP");
		  } catch (e) {
			   try {
			   req = new ActiveXObject("Microsoft.XMLHTTP");
			   } catch (e) {
			   req = false;
			   }
		  }
	 }
//alert(req)
	 if (req) {
	 // Synchronous request, wait till we have it all
		 
	 req.open('GET', url, false);
	 req.send(null);
	 //alert(req.responseText)
	 return(req.responseText);
	 } else {
	 alert("Sorry, your browser does not support " +
		  "XMLHTTPRequest objects. This page requires " +
		  "Internet Explorer 5 or better for Windows, " +
		  "or Firefox for any system, or Safari. Other " +
		  "compatible browsers may also exist.");
	 }
}	
