function checkReg(number)
{
if (/^\\w*$/i.exec(number) != null)                
  {	           
    	return false;                                                                  
  }
  else
  {
  return true;
  } 
}

//-- ###########################  |
//--  START:  Check Survey Form   |
//-- ###########################  V
  function checkSurveyForm()
  { 
    var el = document.surveyForm.elements; 
      for(var i = 0 ; i < el.length ; ++i)
      { 
        if(el[i].type == "radio")
        { 
          var radiogroup = el[el[i].name]; 
          var itemchecked = false; 
            for(var j = 0 ; j < radiogroup.length ; ++j)
            { 
             alert('radiogroup[j]'); 
              if(radiogroup[j].checked)
              { 
                itemchecked = true;
                break; 
              } 
            } 
          if(!itemchecked)
          { 
            alert("Please make a selection"); 
            return false; 
          } 
        } 
      } 
    return true; 
  } 
//-- #########################  ^
//--  END:  Check Survey Form   |
//-- #########################  |


//-- ######################  |
//--  START:  Popup Window   |
//-- ######################  V
  function popUp(url, width, height, left, top, toolbar)
  {
    var intWidth=568;
    var intHeight=400;
    var intLeft=30;
    var intTop=45;
    var intTool=0;
      if(width > 0) intWidth = width;
      if(height > 0) intHeight = height;
      if(left > 0) intLeft = left;
      if(top > 0) intTop = top;
      if(toolbar < 2) intTool = toolbar;
              
    var winPopUp = window.open(url,'popup','width=' + intWidth + ',height=' + intHeight + ',left=' + intLeft + ',top=' + intTop + ',toolbar=' + intTool + ',scrollbars=1,resizable=1');
    winPopUp.focus();
  }
//-- ####################  ^
//--  END:  Popup Window   |
//-- ####################  |

//-- ########################### |
//--  START:  Popup Window Image |
//-- ########################### V
  function popUpImage(url, width, height, left, top, toolbar, scrollbars, resizable)
  {
    var intWidth=568;
    var intHeight=400;
    var intLeft=30;
    var intTop=45;
    var intTool=0;
    var intScrollbars=0;
    var intResizable=0;
      if(width > 0) intWidth = width;
      if(height > 0) intHeight = height;
      if(left > 0) intLeft = left;
      if(top > 0) intTop = top;
      if(toolbar > 0) intTool = toolbar;
      if(scrollbars > 0) intScrollbars = scrollbars;
      if(resizable > 0) intResizable = resizable;
 
    var winPopUp = window.open(url,'popup','width=' + intWidth + ',height=' + intHeight + ',left=' + intLeft + ',top=' + intTop + ',toolbar=' + intTool + ',scrollbars=' + intScrollbars + ',resizable=0' + intResizable);
    winPopUp.focus();
  }
//-- ####################  ^
//--  END:  Popup Window   |
//-- ####################  |


//-- ###################################  |
//--  START:  Popup Coverage Map Window   |
//-- ###################################  V
  function popUpMap(url)
  {
  	var popUpOptions = "width="+(screen.availWidth-15)+",height="+(screen.availHeight-35)+",left=0,top=0,toolbar=0,scrollbars=1,resizable=1";
    var popUpMap = window.open(url,'popUpMap',popUpOptions);
    popUpMap.focus();
  }
  
  function popUpMedia(url)
  {
    var popUpMap = window.open(url,'popUpMap','width=850,height=700,left=10px,top=10px,toolbar=0,scrollbars=1,resizable=0');
    popUpMap.focus();
  }
  
//-- #################################  ^
//--  END:  Popup Coverage Map Window   |
//-- #################################  |



//-- ##############################  |
//--  START:  Text Area Max Length   |
//-- ##############################  V
  function maxLength(obj,i)
  {
    if (obj.value.length >= i) {
      obj.value = obj.value.slice(0,eval(i-10));
      alert("You have reached the maximum number of characters for this field");
    }
  }
//-- ############################  ^
//--  END:  Text Area Max Length   |
//-- ############################  |




//-- #################################### |
//-- START:  Get Product Thumbnail Image  |
//-- #################################### V
    function getThumbnailImage(man,device,img,thumbDeviceName,deviceType){
        if(document.getElementById(device).selectedIndex != 0){
            var brandName   = document.getElementById(man).options[document.getElementById(man).selectedIndex].text;
            var productID   = document.getElementById(device).options[document.getElementById(device).selectedIndex].value;
            var productName = document.getElementById(device).options[document.getElementById(device).selectedIndex].text;
            var imageSrc    = eval("document.getElementById('"+productID+"')").value; 
              document.getElementById(thumbDeviceName).innerHTML = '<img id="'+img+'" name="'+img+'" '+
                'src="'+ imageSrc +'" height="75" border="0">'+
                '<br>' +
                                '<br> &nbsp;' + brandName + '&nbsp;'+ productName + ' &#x203A;';
         }
          
        else{
            //document.getElementById(img).src = "images/spacer.gif";
            document.getElementById(thumbDeviceName).innerHTML = '';
         }
    }
//-- ################################### ^
//--  END:  Get Product Thumbnail Image  |
//-- ################################### |
          
        
//-- ############################ |
//--  START:  Check For Go Image  |
//-- ############################ V
//    function checkForGO(){
//     if(document.getElementById("tree").selectedIndex == 0){
//       if(document.getElementById("servicesGO") != null){
//         document.getElementById("servicesGO").style.display = "none";
//       }
//     }
//    }
//-- ########################## ^
//--  END:  Check For Go Image  |
//-- ########################## |


//-- ########################### |
//--  START:  View Product Info  |
//-- ########################### V
    function View(type){
     if(type == "product"){
       //document.getElementById("manufacturerForm").action = "/main.html";
         document.getElementById("manufacturerForm").submit();
       }
     if(type == "service"){
       //document.getElementById("featuresForm").action = "/main.html";
       document.getElementById("featuresForm").submit();
       }
    }
//-- ######################### ^
//--  END:  View Product Info  |
//-- ######################### |



//-- ############################## |
//--  START:  Load Thumbnail Image  |
//-- ############################## V
  function LoadThumbNail(){
   if(document.getElementById("selectedDeviceId") != null){
     getThumbnailImage('selectProductManufacturer','selectedDeviceId','productDeviceThumbNail','productThumbDeviceName');
     }
   if(document.getElementById("selectServiceDevice") != null){
     getThumbnailImage('selectServiceManufacturer','selectServiceDevice','serviceDeviceThumbNail','serviceThumbDeviceName');
     }
  }
//-- ############################ ^
//--  END:  Load Thumbnail Image  |
//-- ############################ |




//function resizeDisableDiv() {
//  var winW = 630, winH = 460;
//
//  if (parseInt(navigator.appVersion)>3) {
//   if (navigator.appName=="Netscape") {
//    winW = window.innerWidth;
//    winH = window.innerHeight;
//   }
//   if (navigator.appName.indexOf("Microsoft")!=-1) {
//    winW = document.body.offsetWidth;
//    winH = document.body.offsetHeight;
//   }
//  }
//  
//  DivW = document.getElementById("disableDivBkg").style.width=winW;
//  DivH = document.getElementById("disableDivBkg").style.height=winH;
//  alert("WindowInnerWidth: "+winW + ", WindowInnerHeight: "+winH);
//  alert("DivInnerWidth: "+DivW + ", DivInnerHeight: "+DivH);
//  
//
//}
