// window.onload= tryhello; 
//function() {
//alert ('hi');
//return;
//document.onmousemove= showPosition;
//}
//window.onerror = ErrorSetting; 
var saveaction3='';
var saveaction4='';
var ix1;
var ix2;
var t;
var formname='form1';
//var elementname='';
var savesearch='';
var countchecks=0;
var settoempty; 
var debugtr=false;
var debugstring='';
var theremoves = new Array();
theremoves[0] = ',.music.,';
theremoves[1] = ',.video.,';
theremoves[2] = ',.images.,';
theremoves[3] = ',.business.,';
theremoves[4] = ',.shopping.,';
theremoves[5] = ',.tags.,';
theremoves[6] = ',.checkall.,';
var mainremoved='';
var somethinggotchecked=''; 

var mainbutton='';
var zzz='';
var yyy='';
var xxx='';
var k ='';
var already_processing = 'false';
function changeImage(name, url) {
  if (document.images[name]) {
    document.images[name].src = url;
  }
}
 

function popup_window( url, id, width, height )
{
  popup = window.open( url, id, 'toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=yes,width=' + width + ',height=' + height + ',left=50,top=50' );
  popup.focus();
}

 


var doImage = doImage;
var TType = TType;
 



//Benxamin wrote: 
//> Try double-clicking the yellow triange of death in the lower corner of 
//> your IE browser window. It should pop-up a dialog box that allows you 
//> to check "Always display this message when a page contains errors." And 
//> then it gives you what it interpreted went wrong. 

//> Tony's right. Go to 'GetFirefox.com' and download it. The JavaScript 
//> console under the Tools menu is WORTH IT. Also invaluable is the Web 
//> Developer extension. 



//Else you can use the following function that will alert you every time 
//with the line number, 
//message and with the file name 
function ErrorSetting(msg, file_loc, line_no) { 
        var e_msg=msg; 
        var e_file=file_loc; 
        var e_line=line_no; 
        var   error_d = "Error in file: " + file_loc + 
                            "\nline number:" + line_no + 
                             "\nMessage:" + msg; 
                alert("                      Error Found !!!\n --------------\n"+error_d); 

        return true; 



}

function toggle5(showHideDiv, switchImgTag) {
    var ele = document.getElementById(showHideDiv);
    var imageEle = document.getElementById(switchImgTag);
    if (ele.style.display == "block") {
        ele.style.display = "none";
        imageEle.innerHTML = '<img src="images/plus.png" border=0>';
    }
    else {
        ele.style.display = "block";
        imageEle.innerHTML = '<img src="images/minus.png" border=0>';
    }
}


function toggle6(showHideDiv, switchImgTag) {
    var ele = document.getElementById(showHideDiv);
    var imageEle = document.getElementById(switchImgTag);
    if (ele.style.display == "block") {
        ele.style.display = "none";
        imageEle.innerHTML = '<img src="images/plus.gif" border=0>';
    }
    else {
        ele.style.display = "block";
        imageEle.innerHTML = '<img src="images/minus.gif" border=0>';
    }
}


function toggle7(showHideDiv, switchImgTag) {
    var ele = document.getElementById(showHideDiv);
    var imageEle = document.getElementById(switchImgTag);
    if (ele.style.display == "block") {
        ele.style.display = "none";
        imageEle.innerHTML = '<img src="images/book_plus2.jpg" border=0>';
    }
    else {
        ele.style.display = "block";
        imageEle.innerHTML = '<img src="images/book_minus2.jpg" border=0>';
    }
} 

function bbl() {
   // var e_url = url;
    //alert(e_url);
//if (url == null) return;

//window.location=url;
//var t = document.getElementById("searchwords");// t.focus();
}

function redir(){
//var t = document.getElementById("searchwords");// t.focus();
}



function myHover(tbl, idx, cls)
{
 // alert ('in myhover');
	var t = document.getElementById(tbl);
	if (t == null) return;
	var d = t.getElementsByTagName("TD");
	if (d == null) return;
	if (d.length <= idx) return;
	d[idx].className = cls;
}

 

 
var ischecked ='';
var isblocked ='';
var category1='';
var category2='';
var category3='';
var category4='';
var allowed_types='';
var action_string='';
var trim_name='';var suffix1='';





var x,y;
function showPosition(e) {

if (window.event)
  {
  x= window.event.clientX;
  y=window.event.clientY;
} else {
 x = e.pageX;
 y = e.pageY;
}
window.status = "x:" + x + ", y: " + y;  
// alert ("x:" + x + ", y: " + y);
}
var objPopUp = null;
			
			function popUp(event,objectID) {
//alert ('hi');
if (window.event)
  {
  x= window.event.clientX;
  y=window.event.clientY;
} else {
 x = event.pageX;
 y = event.pageY;
}
window.status = "x:" + x + ", y: " + y;  
// alert ("x:" + x + ", y: " + y);
   				objPopTrig = document.getElementById(event);
 				objPopUp = document.getElementById(objectID);
 				xPos = objPopTrig.offsetLeft;
				yPos = objPopTrig.offsetTop + objPopTrig.offsetHeight;
				if (xPos + objPopUp.offsetWidth >  document.body.clientWidth) xPos = xPos - objPopUp.offsetWidth;
				if (yPos + objPopUp.offsetHeight >  document.body.clientHeight) yPos = yPos - objPopUp.offsetHeight - objPopTrig.offsetHeight;
				objPopUp.style.left = xPos + 'px';
				objPopUp.style.top = yPos + 'px';
                                objPopUp.style.left = x + 15 + 'px';
				objPopUp.style.top = y + 'px';
                                       //                         alert("x " + x + "  y  " + y + ' ypos ' + yPos + ' xPos ' + xPos);
                                                                //var xx =x;
                                                                //xx=x+0;
                                                                //objPopUp.style.top = xx + 'px';
				objPopUp.style.visibility = 'visible';
			}
			
			function popHide() {
				objPopUp.style.visibility = 'hidden';
				objPopUp = null;
			}

function PrintButtonClick()
{
	if( typeof(frmRatings)=="object" ){
		var oPrint = frmRatings.document.getElementById("Print");
		if(oPrint != null) oPrint.click();
	}
	else
	{
		OnPrintPage();
	}
}
function ToggleMenu(oButton, oItems)
{
//alert ('we are here');

//alert (oButton.src);
//alert (oItems.style.display);
//return;
// alert("Please enter a valid QuickJump Code");
	if (oItems.style.display == "none")	
	{
// alert("style display=block");
		oItems.style.display = "block";
		oButton.src = "images/minus.gif";
	}	
	else 
	{
// alert("style display=none");
		oItems.style.display = "none";
		oButton.src = "images/plus.gif";
//		oButton.src = "images/minus.gif";
//alert (oButton.src);
// alert (oItems.style.display);
	}
	return;
}

function ToggleMenut(oButton, oItems)
{
//alert ('we are here');

//alert (oButton.src);
//alert (oItems.style.display);
//return;
// alert("Please enter a valid QuickJump Code");
	if (oItems.style.display == "none")	
	{
// alert("style display=block");
		oItems.style.display = "block";
		oButton.src = "http://www.tyrols.com/images/minus.gif";
	}	
	else 
	{
// alert("style display=none");
		oItems.style.display = "none";
		oButton.src = "http://www.tyrols.com/images/plus.gif";
//alert (oButton.src);
// alert (oItems.style.display);
	}
	return;
}
function ToggleMenuw(oButton, oItems)
{
//alert ('we are here');

//alert (oButton.src);
//alert (oItems.style.display);
//return;
// alert("Please enter a valid QuickJump Code");
	if (oItems.style.display == "none")	
	{
// alert("style display=block");
		oItems.style.display = "block";
		oButton.src = "http://www.websearchstore.com/images/minus.gif";
	}	
	else 
	{
// alert("style display=none");
		oItems.style.display = "none";
		oButton.src = "http://www.websearchstore.com/images/plus.gif";
//alert (oButton.src);
// alert (oItems.style.display);
	}
	return;
}

function ToggleOpen(oItems)
{
// alert("Please enter a valid QuickJump Code");
	if (oItems.style.display == "none")	
	{
// alert("style display=block");
		oItems.style.display = "block";
		 
	}	
	else 
	{
// alert("style display=none");
		oItems.style.display = "none";
		 
	}
	return;
}
 

function OnPrintPage(){
	var oWnd = window;
	var oDoc = oWnd.document;
	var strLoc = "default.aspx?print=true";
	if (window.navigator.userAgent.indexOf("MSIE ")!=-1 && navigator.appVersion.substr(0, 1) >= 4){
		if( oWnd.printHiddenFrame == null){
			oDoc.body.insertAdjacentHTML("beforeEnd", "<iframe name='printHiddenFrame' width='0' height='0'></iframe>");
			framedoc = oWnd.printHiddenFrame.document;
			framedoc.open();
			framedoc.write(
				"<frameset name=test onload='printMe.focus();printMe.print();' rows=\"100%\">" +
				"<frame name=printMe src=\""+strLoc+"\">" +
				"</frameset>");
			framedoc.close();
		}
		else{
			oWnd.printHiddenFrame.printMe.focus();
			oWnd.printHiddenFrame.printMe.print();
		}
	}		
	else{
		oWnd.location.href = strLoc;
	}
	return true;
}

function OpenUrl(url)
{
	var childWin;
	childWin = window.open(url,'window','height=300,width=640,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
	childWin.focus();
	//return false;
}

var x=0;
function change()
{
// alert ('hi');
	var coll = document.body.getElementsByTagName("DIV");
	var coll2 = document.body.getElementsByTagName("IMG");
	if (x!=1)
	{
		for (i=0; i<coll.length; i++)
		{
			if (coll[i].style.display=='none' && coll[i].id.indexOf("menu")>-1)
				coll[i].style.display='block';
		}
		// button1.value=" Collapse All "
		x=1
		for (i=0; i<coll2.length; i++)
                                
		{
			if (coll2[i].id.indexOf("btn")>-1)
                                                  {
                                                   // alert ("this one matched" + coll2[i].id); 
				coll2[i].src='images/minus.gif';
                                                  }  
		}
	}
	else 
	{
		for (i=0; i<coll.length; i++)
		{
			if (coll[i].style.display=='block' && coll[i].id.indexOf("menu")>-1)
				coll[i].style.display='none';
		}
		// button1.value=" Expand All "
		x=0
		for (i=0; i<coll2.length; i++)
		{
			if (coll2[i].id.indexOf("btn")>-1)
				coll2[i].src='images/plus.gif';
		}
	}
}


function changenodetails()
{
// alert ('got to here');
	var coll = document.body.getElementsByTagName("DIV");
	var coll2 = document.body.getElementsByTagName("IMG");
	if (x!=1)
	{
		for (i=0; i<coll.length; i++)
		{
			if (coll[i].style.display=='none' && coll[i].id.indexOf("nodetails")>-1)
				coll[i].style.display='block';
		}
		// button1.value=" Collapse All "
		x=1
		 
	}
	else 
	{
		for (i=0; i<coll.length; i++)
		{
			if (coll[i].style.display=='block' && coll[i].id.indexOf("nodetails")>-1)
				coll[i].style.display='none';
		}
		// button1.value=" Expand All "
		x=0
		 
	}
}


/*
function AuthorSearch(author)
{
	var reSpace = /\s/
	author=author.replace(reSpace,"%20");
	window.location.href="/msdnmag/find/default.aspx?type=Au&phrase=" + author;
}

function Go(value)
{
   if(value!="0" && value!=null)
   {
      return true;     
   }
   else
   {
      return false;
   }
}

function Jump(value)
{
	var re = /\d{6}/

   if(re.test(value)&&value.length==6)
   {
      return true;     
   }
   else
   {
		alert("Please enter a valid QuickJump Code");
		return false;
   }
}

*/
function tryhello()
{
alert('hello you all');
} 




 
function add_remove_parms(startstring,whatit,yesorno) {
// get a list of all the body elements (there will only be one),
// and then select the zeroth (or first) such element
// alert ('made it to add remove');
// return;
myBody = document.getElementsByTagName("body")[0];
// now, get all the p elements that are children of the body
myBodyElements = myBody.getElementsByTagName("A");
//myBodyElements = document.getElementsById("ostart1");
//document.axll.checkall_types.checked = false;
// get the second item of the list of p elements
var i;
var j='';
var wholething='';
for  (i=0; i<myBodyElements.length; i++)
   {
   myP = myBodyElements[i];
   // return;
   //j=j + ' ' + (myP.id);
   // j=j + ' ' + myP.type;
   // return;
   // box = eval("document.axll." +myP.name); 
   if (  myP.id.indexOf(startstring)>-1)
      {
      // var whatit='&expanded=';
      //alert (' found 1 ' + myP.id);
      //return;
      wholething=myP.href;
      if (  wholething.indexOf(whatit)>-1)
         {
         j=j + ' ' + (myP.id);
         j=j + ',  found it ,' + myP.href;
         
         var firsta='';
         var firstb='';
         var fff;
         //alert ('wholething href=' + wholething);
         fff=wholething.indexOf(whatit);
         firsta=wholething.substr(0,fff);
         firstb=wholething.substr(fff +whatit.length);
         //alert ('firsta=' + firsta);
         //alert ('firstb=' + firstb);
         fff=firstb.indexOf('&');
         if (fff>-1)
            {
            firstb=firstb.substr(fff);
            } 
            else
            {
            firstb='';
            }
         //alert ('firstb after=' + firstb);
         wholething= firsta + firstb;
         }
     wholething=wholething+whatit + yesorno  ;  
     myP.href= wholething;
     //alert (' added parameter=' +   myP.href);
     //alert (' set ' + myP.id + ' to ' + whatit +yesorno);
     }
   }  
   
 //alert (j);
}


 function process_checkbox(xxx,checkuncheck)

{
//debugstring=debugstring + ' ' + xxx;
 // if (xxx.indexOf('phone')>-1) debugtr=true;
 if (xxx.indexOf('phone')==-1) debugtr=false;
  //if (debugtr==true)  alert ('in process checkbox-'+xxx);
// return;
  
//  alert (document.axll.form1.action);
 // alert('entering process checkbox'); 
  if (already_processing == 'true') 
    {
    // alert (' returning, already processing');
    return;
     }
     else
     {
     already_processing = 'true';
     }
     
      
  //alert (xxx);
   box=  document.getElementById(xxx);
 
 // box = eval("document.axll." + xxx ); 

// alert ("document.axll." + xxx + ".name");
if (box.checked == false)
  {
  //if (debugtr==true) alert ('box is unchecked');
  ischecked ='uncheck';
  isblocked ='none';
  }
  else
  {
  //if (debugtr==true) alert ('box is checked');
  ischecked ='check';
  isblocked ='block';
  somethinggotchecked='true';
  }
//return;
if (checkuncheck=='check') 
  {
  ischecked ='check';
  isblocked ='block';
  }
if (checkuncheck=='uncheck') 
  {
  ischecked ='uncheck';
  isblocked ='none';
  }
if (xxx== 'checkall_types_checkbox')
  {
  category1='detail';
  category2='detail';
  category3='checkall_category';
  category4='checkall_category';
  isblocked =='block';
  mainbutton='checkall';
  zzz=',.checkall.,';
  
  // alert('mainbutton=' + mainbutton);
  //return;
  }
if (xxx.indexOf('checkall_category')>-1)
  {
  category1='checkall_category';
  category2='checkall_category';
  category3='detail';
  category4='detail';
if (debugtr==true) alert ('made it to checkall category');
  // if (xxx.indexOf('checkall_category')>-1) category4='checkall_category';
  
  }
  // alert ('xxx here=' + xxx);

  if (xxx.indexOf('music')>-1) category4='music';
  if (xxx.indexOf('images')>-1) category4='images';
  if (xxx.indexOf('business')>-1) category4='business';
  if (xxx.indexOf('tags')>-1) category4='tags';
  if (xxx.indexOf('web')>-1) category4='business';
  if (xxx.indexOf('video')>-1) category4='video';
  if (xxx.indexOf('shopping')>-1) category4='shopping';
  if (xxx.indexOf('downloads')>-1) category4='downloads';
  category2= category4;
//  alert ('category2 here=' + category2);
 // return; 
// alert ('ischecked=' + ischecked);
//      check_boxes('detail','checkall_category','input','uncheck');
// alert ('yes we are here');
// return; 
if (xxx.indexOf('detail')==-1)
  {
  // alert ('yes we are here 2');
  if (xxx.indexOf('checkall_category')==-1)
    {
    // alert ('yes we are here 4');
    if (isblocked =='block') change_topic('topic','block');
    }
  if (xxx== 'checkall_types_checkbox')
    {
    category2='detail';
    }
  check_boxes(category1,category2,category3,category4,'input',ischecked);
  }

if (xxx.indexOf('detail')>-1)
  {
  if (ischecked =='check')
    {
    category1='detail';
    category2=xxx;
    category3=xxx;
    category4=xxx;
    }
 if (ischecked =='uncheck')
   {
   category1='detail';
   category2=xxx;
   category3='checkall_category';
   }
//  alert ('found detail, xxx=' + xxx);
  // return;
  check_boxes(category1,category2,category3,category4,'input',ischecked);
  }    
        

already_processing = 'false';
//if (somethinggotchecked=='true')
//  {
//  addexpanded("expanded");
//  }
if (countchecks>0) 
{
  addexpanded("expanded");
  }
else
{
  addremoveaction('&expanded=false','remove')
  }

countchecks
// alert ('final action=' + document.axll.form1.action);
mainbutton='';
}


function stop1search(button)
{
// alert('got to stop');
var t = document.getElementById(button);
if (button=="stopbutton")
  {
  t.value="Stopping!!"
  }
if (button=="resumebutton")
  {
  t.value="Resuming Search!!"
  }
}


function add_dataw(value)
{
//alert (value);
addremoveaction('&datawords='+value,'add')
}
function check_boxes(key,key2,key3,key4,whichtype,check_uncheck ) {
        // get a list of all the body elements (there will only be one),
        // and then select the zeroth (or first) such element
       //  alert ('entering check boxes'); 
       //yyy='';
       if (key=='checkall_category')
         {
         if (  debugstring.indexOf('everything')>-1) debugstring=debugstring +'-found category';

         yyy=',.' + key2 +'.,'
         //  alert ('yyy=' + yyy);
         }
        myBody = document.getElementsByTagName("body")[0];

        // now, get all the p elements that are children of the body
         //alert ('whichtype=' +whichtype);
         //return;
        myBodyElements = myBody.getElementsByTagName(whichtype);
        // alert ('got to here1');
          //if (debugtr==true) alert ('key=' + key +', key2=' + key2 +  ', key3=' + key3 + ', key4=' + key4);
        //return;
       // alert ('check_uncheck=' + check_uncheck);
        

        // document.axll.checkall_types.checked = false;
        // alert ('got past here');
        // get the second item of the list of p elements
var i;
var j='';
var k ='';
for  (i=0; i<myBodyElements.length; i++)
 
  {
     myP = myBodyElements[i];
     
    j=j + ' ' + (myP.name);
   j=j + ' ' + myP.type;
   // alert ('j=' +j);
  // return;
  // box = eval("document.axll." +myP.name); 
 // if (myP.name.indexOf(key2)>-1) alert ('found key2 =' +key2);
 //  if (myP.name.indexOf(key)>-1) alert ('found key =' +key);
   if (  (( check_uncheck=='uncheck' && myP.name.indexOf('checkall_types_checkbox')>-1) ||( myP.name.indexOf(key2)>-1 && myP.name.indexOf(key)>-1)|| (myP.name.indexOf(key3)>-1 && myP.name.indexOf(key4)>-1))  && myP.type == 'checkbox' && (k.indexOf(myP.name == -1) || add_remove=='remove'))
     {
     k = k + ' ' + myP.name;
       if (  debugstring.indexOf('everything')>-1) debugstring=debugstring +'-' +myP.name;

     //if (debugtr==true)  alert ('found a checkbox ' + myP.name);
     //return;
     box=  document.getElementById(myP.name);
     // box = eval("document.axll." +myP.name); 
  //   if (box.checked == false) 
      {
   //     alert(myP.name + ' is not checked');
 // alert ('check_uncheck=' + check_uncheck + ' already_processing=' + already_processing);
      if (check_uncheck == 'check')
       {
        //debugstring=debugstring + '-' + myP.name;
        // alert ('got to check');
         // return;
        box.checked = true;
        // yyy='';
        if (myP.name.indexOf('checkall_category')>-1  && mainbutton=='checkall')
            {
            var keyxx='';
            if (myP.name.indexOf('music')>-1) keyxx='music';
            if (myP.name.indexOf('images')>-1) keyxx='images';
            if (myP.name.indexOf('business')>-1) keyxx='business';
            if (myP.name.indexOf('tags')>-1) keyxx='tags';
            if (myP.name.indexOf('web')>-1) keyxx='tags';
            if (myP.name.indexOf('video')>-1) keyxx='video';
            if (myP.name.indexOf('shopping')>-1) keyxx='shopping';
            yyy=',.' + keyxx +'.,'
            //alert ('mainbutton set, yyy=' + yyy);
          }
        processaction(myP.name,'add'); 
        }
         if (check_uncheck == 'uncheck')
      {
        // alert ('got to uncheck');
         // return;
         box.checked = false;
        processaction(myP.name,'remove'); 
        }
     
       // else
      {
       // alert(myP.name + ' is checked');
    //   box.checked = false;
       }  
    }
    
   }

}
//  alert (j);
}
// *-
// *-
function processaction(thename, add_remove)
{ 
t = document.getElementById('form1');
saveaction3=t.action;    
 var part333;
 part333='';
 var save1='';
 var save2='';
 var saveaction='';
 //alert ('in processaction=' + thename);
 if (add_remove=="remove")
   {
 // alert ('in processaction=' + thename);
 }
 // return;
 working='checkall';
 
 if (thename.indexOf(working)>-1)
   {
   // alert ('found category, returning');
   return;
   }

  // ok to here
t = document.getElementById('form1');
 action_string=t.action;    
// action_string=document.axll.form1.action;
 // alert ('action string111=<br>' + action_string + '<br>&allowedtypes');
 if (action_string.indexOf('allowed')==-1)
   {
   settoempty='false';
   allowedtypes='&allowedtypes=';
   saveaction=action_string;
   //alert ('didnt find allowedtypes 1');
   // action_string= action_string + allowedtypes;
   }
   else
   {
   var ij=0;
   var saveallowed;
   ij=action_string.indexOf('&allowedtypes');
   allowedtypes=action_string.substring(ij);
   //alert ('found allowedtypes 2 ' + allowedtypes );
   saveaction=action_string.substring(0,ij);
   var fff;
   var ggg;
 
   part333='';
   saveallowed='';
   ggg='&allowedtypes=';
   fff=allowedtypes.indexOf(ggg);
          if (fff>-1)
             {
              saveallowed=allowedtypes.substr(fff,ggg.length);
             
              part333=allowedtypes.substr(fff+ggg.length);
              
              //alert ('saveallowed1 =' + saveallowed);
              //alert('part3331=' + part333);
             // if (zzz==',.checkall.,' && add_remove=='remove')
              //  {
                //alert('got to hereeee');

             //   } 
              if (settoempty=='true') 
                 {
                  //alert('part3331 was=' + part333);
                  settoempty='false';
                 part333='';
                // alert('part3331 now=' + part333);
                 }
              //return;
              ggg='&';
              fff=part333.indexOf(ggg);
              if (fff>-1)
                {
                 saveallowed=saveallowed+part333.substr(0,fff);
                 part333=part333.substr(fff);
                 //alert ('saveallowed 2=' + saveallowed);
                 //alert('part333 2=' + part333);
                 allowedtypes=saveallowed;
                //return;
                 }
                else
                 {
                  allowedtypes=saveallowed+part333;
                  part333='';
                  }
 
              }
 
   //alert ('got to here in processaction 2, allowed_types=' + allowedtypes + ' saveaction=' + saveaction);
   }
// ok to here 2
 trim_name=thename;
 unmake(trim_name);
 // alert (' trim_name=' + trim_name);
 var working='';
 working='detail_';
 
 if (trim_name.indexOf(working)>-1)
   {
   trim_name=trim_name.substr(working.length);
   // alert('trim_name now=' + trim_name);
  // return;
   }
  if (trim_name.indexOf('music')>-1) working='music_';
  if (trim_name.indexOf('images')>-1) working='images_';
  if (trim_name.indexOf('business')>-1) working='business_';
  if (trim_name.indexOf('tags')>-1) working='tags_';
  if (trim_name.indexOf('web')>-1) working='business_';
  if (trim_name.indexOf('video')>-1) working='video_';
  if (trim_name.indexOf('shopping')>-1) working='shopping_';
  if (trim_name.indexOf(working)>-1)
   {
   trim_name=trim_name.substr(working.length);

   // alert('trim_name now2=' + trim_name);
   // return;
   }
 working='_checkbox';
 
 if (trim_name.indexOf(working)>-1)
   {
   ij=trim_name.indexOf(working);
   trim_name=trim_name.substr(0,ij);
   // alert('trim_name now 3=' + trim_name);
  // return;
   }
 if (  debugstring.indexOf('everything')>-1) debugstring=debugstring +'-trimname:<b>' +trim_name +'</b>';

  // alert('final trim_name now 3=' + trim_name);
  // return;
 //if (add_remove=="remove")
 //  {
  // if (suffix1.indexof(',')==-1)
  //   {suffix1=',' + suffix1;}
 //  }
 var rein;
  // alert ("suffix1=" + suffix1)
 rein=suffix1.indexOf(',');
 // alert ('rein=' + rein);
 rein=suffix1.length;
 // alert ('length=' + rein);
 var rein2;
 rein2=suffix1.substr(rein-1,1);
 // alert ('last char=' + rein2);
 if (rein2 != ',')
   {
   suffix1=suffix1 + ",";
   }
 // alert ("suffix1 after=" + suffix1);
 trim_name=suffix1;
 if (add_remove=="remove")
   {
   // alert ("suffix1=" + suffix1)
   }
 if (  debugstring.indexOf('everything')>-1) debugstring=debugstring +'-suffix:' +suffix1;

 // return;
// ok to here 4
 if (allowedtypes.indexOf(trim_name )==-1 &&  add_remove=='add')
    {
       if (  debugstring.indexOf('everything')>-1) debugstring=debugstring +'-adding:' +trim_name;

    opendatawords(add_remove);

      if (yyy!='')
       {
      if (allowedtypes.indexOf(yyy)==-1)
         {
         //alert ('added yyy, allowedtypes here before=' + allowedtypes);  
         allowedtypes=allowedtypes + yyy ;
         // alert ('added yyy, allowedtypes here after=' + allowedtypes);
         }
      }
 if (zzz!='')
       {
      if (allowedtypes.indexOf(zzz)==-1)
         {
         allowedtypes= allowedtypes+zzz   ;
         // alert ('added zzz, allowedtypes here=' + allowedtypes);
         zzz='';
         }
   
      }
     allowedtypes=allowedtypes + trim_name ;
    // alert ('yyy here=' + yyy);
    //alert ('allowedtypes here=' + allowedtypes);
   
     
    }
// ok to here 5
  //  alert('allowedtypes now2 is ' + allowedtypes);
 
    
   t = document.getElementById('form1');
   t.action=saveaction + allowedtypes;
 t = document.getElementById('form2');
   t.action=saveaction + allowedtypes;
   // document.axll.form1.action= saveaction + allowedtypes;
   // document.axll.form2.action= saveaction + allowedtypes;
    box = document.getElementById('expanded');
    // box = eval("document.axll.expanded" );
    if (box.checked == false)
      {
      
      box.checked=true;
      addexpanded("expanded");
 
      }
// *-     // come back here
// *-  }
// *-// alert ('allowedtypes=' + allowedtypes);
 if (allowedtypes.indexOf(trim_name )>-1 && add_remove=='remove')
   {
   opendatawords(add_remove);
 
    //alert ('yyy here=' + yyy);
   if (yyy!='')
      {
      if (allowedtypes.indexOf(yyy)>-1)
        {
        ij=allowedtypes.indexOf(yyy);
        if (ij>-1)
           {
            //alert ('allowedtypes before1 =' + allowedtypes);
            save1=allowedtypes.substring(0,ij);
            save2=allowedtypes.substring(ij+yyy.length);
            allowedtypes=save1 + save2;
            // alert ('allowedtypes after1 =' + allowedtypes);
            }
         }
      }

   if (zzz!='')
      {
      if (allowedtypes.indexOf(zzz)>-1)
        {
        ij=allowedtypes.indexOf(zzz);
        if (ij>-1)
           {
            //alert ('allowedtypes before zzz removed =' + allowedtypes);
            save1=allowedtypes.substring(0,ij);
            save2=allowedtypes.substring(ij+zzz.length);
            allowedtypes=save1 + save2;
            zzz='';
            // alert ('allowedtypes after zzz removed =' + allowedtypes);
            }
         }
      }

    
    if (mainbutton=='checkall'  && mainremoved != 'true')
      {
      //alert('got to remove part');
      for (i=0; i<theremoves.length; i++)
        {
        yyy=theremoves[i];
        // alert ('yyy=' + yyy);
        if (allowedtypes.indexOf(yyy)>-1)
          {
          ij=allowedtypes.indexOf(yyy);
          if (ij>-1)
            {
            //alert ('allowedtypes before1 =' + allowedtypes);
            save1=allowedtypes.substring(0,ij);
            save2=allowedtypes.substring(ij+yyy.length);
            allowedtypes=save1 + save2;
            // alert ('allowedtypes after theremoves =' + allowedtypes);
            }
          }
       mainremoved='true';
       }
    }
   ij=allowedtypes.indexOf(trim_name);
   //alert('ij=' + ij);
   //alert('trim name=' + trim_name);
 
 
   save1=allowedtypes.substring(0,ij);
   save2=allowedtypes.substring(ij+trim_name.length);
   // alert ('save1=' + save1);
   // alert ('save2=' + save2);
 
   allowedtypes=save1 + save2;
   //alert ('allowedtypes after=' + allowedtypes);
 
   }
 
 // alert ('saveaction is=' + saveaction );

// saveaction4=t.action;  
t = document.getElementById('form1');
t .action= saveaction + part333 + allowedtypes  ;
t = document.getElementById('form2');
t .action= saveaction + part333 + allowedtypes  ;
 // document.axll.form1.action= saveaction + part333 + allowedtypes  ;
// document.axll.form2.action= saveaction +  part333 + allowedtypes ;
 var ccc='';
 ccc=saveaction + allowedtypes;
 // alert (  '< action after in processaction=' + document.axll.form1.action);
 
    yyy='';

ix1=saveaction3.indexOf('&c_id=');
ix2=saveaction4.indexOf('&c_id=');
if (ix1>-1  && ix2==-1 ) 
  {
//  alert ('thename is ' + thename + ' action before is: ' + saveaction3 + ' action after is: ' + saveaction4);
  }  
  }
function opendatawords(ar)
{
if (ar=='add') countchecks=countchecks+1;
if (ar=='remove') countchecks=countchecks-1;
//    alert ('countchecks=' + countchecks);
var t = document.getElementById('datawordsmenu'); 
if (countchecks>0) 
  {
  //alert('countchecks more than 0');
  if (t.style.display =="none") t.style.display = "block";
  }
else
  {
  if (t.style.display =="block") t.style.display = "none";
  }

}

// function to capture flag_choose_value
function capture_choose_flag() {
    var x = document.getElementById('choose_flags_value');
    var y = document.getElementById('choose_flags');
    x.value = y.value;
    window.document.all["choose_flags_value"].value = window.document.all["choose_flags"].value;
}
    
 // end function to capture flag choose value
// Counts characters
 

function choosesearch(whichone)
{
var t; 
 
if (  whichone.indexOf('our')>-1)
  {
  t = document.getElementById('oursearchbar'); 
  if (t.style.display =="none") t.style.display = "block";
  t = document.getElementById('googlesearchbar'); 
  if (t.style.display =="block") t.style.display = "none";
  }
else
  {
  t = document.getElementById('oursearchbar'); 
  if (t.style.display =="block") t.style.display = "none";
  t = document.getElementById('googlesearchbar'); 
  if (t.style.display =="none") t.style.display = "block";
  }

}
 
function unmake(thename2)
{
var aj;
var ajj='';
ajj='_lp_';
   if (  debugstring.indexOf('everything')>-1) debugstring=debugstring +'-in unmake:' +thename2;
//alert(thename2);
aj=thename2.indexOf(ajj);
if (aj>-1)
  {
  suffix1=thename2.substring(aj+ajj.length);
  }
  else
  {
if (thename2.indexOf('email')>-1) suffix1=',email' ;
  if (thename2.indexOf('address')>-1) suffix1=',adr' ;
  if (thename2.indexOf('adr')>-1) suffix1=',adr' ;
 if (thename2.indexOf('phone')>-1) suffix1=',phone' ;
 if (thename2.indexOf('zip')>-1) suffix1=',zip' ;
 if (thename2.indexOf('keyw')>-1) suffix1=',keyw' ;
 if (thename2.indexOf('desc')>-1) suffix1=',desc' ;
 if (thename2.indexOf('title')>-1) suffix1=',title' ;
if (thename2.indexOf('price')>-1) suffix1=',price' ;
if (thename2.indexOf('product')>-1) suffix1=',product' ;
  
  return;
  }
ajj='_rp_';
aj=suffix1.indexOf(ajj);
suffix1=suffix1.substring(0,aj);
//alert (' in unmake , suffix1 0=' + suffix1);
 
//alert (' in unmake , suffix1 1=' + suffix1);
ajj='_dt_';
aj=suffix1.indexOf(ajj);
//alert ('aj=' + aj);
 
while (aj>-1)
  {
  //alert (' in unmake while , suffix1 2a=' + suffix1);
  //alert ('aj=' + aj);
  suffix1=suffix1.substring(0,aj) + ',' + suffix1.substring  (aj+ajj.length); 
  aj=suffix1.indexOf(ajj);
  //alert (' in unmake while , suffix1 2b=' + suffix1);
  }
ajj='_';
aj=suffix1.indexOf(ajj);
//alert ('aj=' + aj);
 
while (aj>-1)
  {
  //alert (' in unmake while , suffix1 2a=' + suffix1);
  //alert ('aj=' + aj);
  suffix1=suffix1.substring(0,aj) + suffix1.substring  (aj+ajj.length); 
  aj=suffix1.indexOf(ajj);
  //alert (' in unmake while , suffix1 2b=' + suffix1);
  }
//alert (' in unmake , suffix1 3=' + suffix1);
}

function start() {
        // get a list of all the body elements (there will only be one),
        // and then select the zeroth (or first) such element
        myBody = document.getElementsByTagName("body")[0];

        // now, get all the p elements that are children of the body
        myBodyElements = myBody.getElementsByTagName("input");
       t = document.getElementById('checkall_types.checked');
       t .checked=false;
       document.axll.checkall_types.checked = false;
        // get the second item of the list of p elements
var i;
var j='';
for  (i=0; i<myBodyElements.length; i++)
  {
    myP = myBodyElements[i];
   // j=j + ' ' + (myP.name);
   j=j + ' ' + myP.type;
  // return;
   // box = eval("document.axll." +myP.name); 
   if (  myP.name.indexOf("detail_")>-1)
     {
     // if (box.checked == false) 
       {
       // alert(myP.name + ' is not checked');
     //  box.checked = true;
       }
     //  else
       {
       // alert(myP.name + ' is checked');
    //   box.checked = false;
       }  
     }
    
    }
 alert (j);
}




function change_topic(key,result)
{
var x=0;
	var coll = document.body.getElementsByTagName("DIV");
	var coll2 = document.body.getElementsByTagName("IMG");
// alert ('in change topic');
// alert ('key is=' + key);
// alert ('result is=' + result);
// return;
	if (x!=1)
	{
		for (i=0; i<coll.length; i++)
		  {
                                  // alert ('got to here');
	                  if (coll[i].style.display=='none' && coll[i].id.indexOf(key)>-1)	
                                    {  
                                     // alert ('found the key=' + key);
		     coll[i].style.display='block';
                                     }
                                  }
	
		x=1
		for (i=0; i<coll2.length; i++)
                                  {
                                  // alert ('got to 2nd loop');
		  if (coll2[i].id.indexOf("button")>-1 && coll2[i].id.indexOf(key)>-1)
                                                  {
                                                 // alert ("this one matched" + coll2[i].id); 
			  coll2[i].src='images/minus.gif';
                                                  }  
		  }
	}
	else 
	{
		for (i=0; i<coll.length; i++)
		{
			if (coll[i].style.display=='block' && coll[i].id.indexOf("menu")>-1)
				coll[i].style.display='none';
		}
		// button1.value=" Expand All "
		x=0
		for (i=0; i<coll2.length; i++)
		{
			if (coll2[i].id.indexOf("btn")>-1)
				coll2[i].src='images/plus.gif';
		}
	}
// alert ('at end of routine');
}
 
function mousecoloroff(categoryx)
{
switch (categoryx) {

    case 'web':{x = document.getElementById('webcolor');x.color="#0000FF";break;}
    case 'images':{x = document.getElementById('imagescolor');x.color="#0000FF";break;}
    case 'video':{x = document.getElementById('videocolor');x.color="#0000FF";break;}
    case 'music':{x = document.getElementById('musiccolor');x.color="#0000FF";break;}
    case 'shopping':{x = document.getElementById('shoppingcolor');x.color="#0000FF"; break;}
    case 'business':{x = document.getElementById('businesscolor');x.color="#0000FF";break;}


    
}
var caseon;
x = document.getElementById('category_inline');
caseon=x.value;
switch (caseon) {

  case 'web':{x = document.getElementById('webcolor');x.color="#FF6600";break;}
    case 'images':{x = document.getElementById('imagescolor');x.color="#FF6600";break;}
    case 'video':{x = document.getElementById('videocolor');x.color="#FF6600";break;}
    case 'music':{x = document.getElementById('musiccolor');x.color="#FF6600";break;}
    case 'shopping':{x = document.getElementById('shoppingcolor');x.color="#FF6600"; break;}
    case 'business':{x = document.getElementById('businesscolor');x.color="#FF6600";break;}

 
  
}
}

function mousecoloron(categoryx)
{
var x;var y;
// first we check to see what the value of 'wt' is

switch (categoryx) {

    case 'web':{x = document.getElementById('webcolor');x.color="#FF6600";y = document.getElementById('web');y.style.cursor="hand";break;}
    case 'images':{x = document.getElementById('imagescolor');x.color="#FF6600";y = document.getElementById('images');y.style.cursor="hand";break;}
    case 'video':{x = document.getElementById('videocolor');x.color="#FF6600";y = document.getElementById('video');y.style.cursor="hand";break;}
    case 'music':{x = document.getElementById('musiccolor');x.color="#FF6600";y = document.getElementById('music');y.style.cursor="hand";break;}
    case 'shopping':{x = document.getElementById('shoppingcolor');x.color="#FF6600";y = document.getElementById('shopping');y.style.cursor="hand";break;}
    case 'business':{x = document.getElementById('businesscolor');x.color="#FF6600";y = document.getElementById('business');y.style.cursor=="hand";break;}

   
    }
}
// function to choose action
function choose_action1(theaction) {

    var t;
    t = document.getElementById('form0');
    t.action = theaction
}
 // end function to choose action
 
 
 
function setcategory2(categoryx)

{

var t;
t = document.getElementById('form1'); 
saveaction3=t.action;
var caseon;
var x;
debugstring=debugstring + '-' + 'we are in set category';
// first we check to see what the value of 'wt' is

x = document.getElementById('category_inline');
caseon=x.value;
// alert ('caseon=' + caseon);
// alert ('categoryx=' + categoryx);

// now we turn them all back to the default color

t = document.getElementById('webcolor');t.color="#0000FF";
t = document.getElementById('imagescolor');t.color="#0000FF";
t = document.getElementById('videocolor');t.color="#0000FF";
t = document.getElementById('musiccolor');t.color="#0000FF";
t = document.getElementById('shoppingcolor');t.color="#0000FF";
t = document.getElementById('businesscolor');t.color="#0000FF";
 
// now we turn the new chosen one to the orange color
 
switch (categoryx)
  {
  case 'web':{t = document.getElementById('webcolor');t.color="#FF6600";break;}
  case 'images': {t = document.getElementById('imagescolor');t.color="#FF6600";break;}
  case 'video':{t = document.getElementById('videocolor');t.color="#FF6600";break;}
  case 'music':{t = document.getElementById('musiccolor');t.color="#FF6600";break;}
  case 'shopping':{t = document.getElementById('shoppingcolor');t.color="#FF6600";break;}
  case 'business':{t = document.getElementById('businesscolor');t.color="#FF6600";break;}
   }

// now we set the variable wt in the hidden html field 

t = document.getElementById('category_inline');t.value=categoryx;
debugstring=debugstring +'category set to '+categoryx;
// now we add variable wt to the parameters as 'category'
 
var category;   
category='&category='+categoryx ;

// now we add the new category to the parameters  

addremoveaction(category,'add');

// now we take care of extra categories 
var theparm='';
var category_extra='';
category_extra=categoryx;
switch (category_extra) 
   {
   case 'business':category_extra='business';break;
   case 'shopping':category_extra='shopping';break;
   case 'web':category_extra='tags';break;
   }

// now we uncheck all other options

theparm='checkall_types_checkbox';
process_checkbox(theparm,'check');  
process_checkbox(theparm,'uncheck');  
debugstring=debugstring + '-' + 'we checked and unchecked everything';
// alert ('got to here, no problem');


// now we un hide the category 

theparm='checkall_category_' + category_extra + '_checkbox';
change_topic('topic','block');

settoempty='true';
//if (debugtr==true)  alert ('got to here, no problem2 '+theparm);
//return;
debugstring=debugstring + '-' + 'about to process='+theparm;
process_checkbox(theparm,'check');  

addexpanded("expanded");
t = document.getElementById('form1'); 

var action_string;
action_string=t.action;
// alert('final action is='+action_string);
var p1='';
var p2='';
var p3='';
p1=categoryx.substring(0,1);
p2=categoryx.substring(1);
p1=p1.toUpperCase();
p3=p1+p2;
t = document.getElementById('category'); //alert ('innerhtml='+t.innerHTML);
t.innerHTML=p3+ " Search";
var savedoc='';
savedoc=document.title;

// put the title on the page

if (  savedoc.indexOf('Store')>-1)
  {
  document.title ="Web Search Store - " +p3  + " Search";
  //alert ('got to web search');
  }
else
  {
  //alert ('got to tyrols');
  document.title ="Tyrols - " +p3  + " Search";
  }

x = document.getElementById('category_inline');
x.value=categoryx;
x = document.getElementById('form1');
// alert ('debug string=' + debugstring);
debugstring='';
category='&category='+categoryx ;

// now we add the new category to the parameters  

addremoveaction(category,'add');


// alert ('final action in setcategory !! is ' + x.action);
x = document.getElementById('category');
caseon=x.value;
//alert(caseon);
x.value=categoryx;
x = document.getElementById('category_inline');
caseon=x.value;
//alert(caseon);
x.value=categoryx;
//
 
x = document.getElementById('thesearchwords');
//alert ('searchwords='+x.value+ ' length='+ x.length);
var dd;
dd=x.value;
//alert ('dd='+dd+ ' length='+ dd.length);
if (dd.length==0)
  {
   x = document.getElementById('defaultsearchterm');
  dd=x.value;
  }
if (dd.length==0)
   {
   dd='camera';
   }

  
if (dd.length==0)
  {
//   alert('its 0');
  }
else
  { 
  x = document.getElementById('form1');
//  alert ('it is ' +x.action);
  if (  x.action.indexOf('searchwords=')>-1)
    {
//    alert ('searchwords found');
    }
  else
    {
 //   alert ('searchwords not found');
    x.action=x.action +'&searchwords=' + dd;
    }
  //  alert ('it is 2 ' +x.action);


 

    window.location.href=x.action
    
   }
 
return;  

}

function addexpanded(theid)
{
//  alert ('got to addexpanded theid=' + theid);
box = document.getElementById('form1'); 
//box = eval("document.axll." + theid ); 
if (box.checked == false)
  {
  // alert ('box is unchecked');
  addremoveaction('&expanded=false','remove')
  }
  else
  {
  // alert ('box is checked');
  addremoveaction('&expanded=true','add')
  }
  // alert ('expand processed: ' + document.axll.form1.action);
}


function showit()
{
t = document.getElementById('form1'); 
alert ('action=' + t.action); 
}

function adddetailsonly(theid)
{
  // alert ('theid=' + theid);
box = document.getElementById(theid); 
// box = eval("document.axll." + theid ); 
if (box.checked == false)
  {
  // alert ('box is unchecked');
  addremoveaction('&detailsonly=false','remove')
  }
  else
  {
  // alert ('box is checked');
  addremoveaction('&detailsonly=true','add')
  }
   // alert ('expand processed: ' + document.axll.form1.action);
}

 


function addremoveaction(theparm,addorremove)
  {
var saveaction1='';
  var saveaction2='';

   //alert('in addremoveaction' +theparm);
    var t;
   
  var savetheparm;
  var savetheparm2;
  var savetheparm3;
  
  if (theparm.indexOf('&')==-1) theparm='&'+theparm;
  savetheparm=theparm;
  var ij=0;
  ij=savetheparm.indexOf('=');
  if (ij>-1)
   {
    savetheparm2=savetheparm.substring(0,ij);
    savetheparm3=savetheparm.substring(ij+1);
    // alert ('got to here in addremoveaction, savetheparm2=' + savetheparm2 + ' savetheparm3=' + savetheparm3);
    }
   // return;
  
 

  
  //var t;
  t = document.getElementById('form1'); 
  action_string=t.action;
  // alert('the action is:'+action_string);
   
  //action_string=document.axll.form1.action;
  // alert ('action string=' + action_string);
  if (action_string.indexOf(savetheparm2)==-1) 
    {
    action_string=action_string + theparm;
    //document.axll.form1.action=action_string;
    t.action=action_string;
    t = document.getElementById('form2'); 
    t.action=action_string;
   //document.axll.form2.action=action_string;
   // alert ('action done, now is: ' + document.axll.form1.action);
   //return;
    }
  else
    {
    ij=action_string.indexOf(savetheparm2);
    if (ij>-1) 
      {
      saveaction1=action_string.substring(0,ij);
      saveaction2=action_string.substring(ij+1+savetheparm2.length);
      //alert ('parm was there ' + savetheparm2 + ' , saveaction1=' + saveaction1 + ' saveaction2=' + saveaction2);
       
      ij=saveaction2.indexOf('&');
      if (ij>-1) 
        {
        saveaction2=saveaction2.substring(ij);
        }
        else
        {
        var saveaction22;
        saveaction22=saveaction2;
        saveaction2='';
        // alert ('saveaction2 was ' + saveaction22 + ', set to null');
        }   
         
         
      var newaction;
      if (addorremove=='add')
        {
        newaction=saveaction1 + theparm +saveaction2;
        } 
        if (addorremove=='remove')
        {
        newaction=saveaction1 +saveaction2;
        } 
       t = document.getElementById('form1'); 
       t.action=newaction;
       t = document.getElementById('form2'); 
       t.action=newaction;
      //document.axll.form1.action=newaction;
      //document.axll.form2.action=newaction;
      //  alert ('form action now is:>' + t.action +'<');
      }
   }


  }
 


 
function add_remove_parms(startstring,whatit,yesorno) {
// get a list of all the body elements (there will only be one),
// and then select the zeroth (or first) such element
// alert ('made it to add remove');
// return;
myBody = document.getElementsByTagName("body")[0];
// now, get all the p elements that are children of the body
myBodyElements = myBody.getElementsByTagName("A");
//myBodyElements = document.getElementsById("ostart1");
//document.axll.checkall_types.checked = false;
// get the second item of the list of p elements
var i;
var j='';
var wholething='';
for  (i=0; i<myBodyElements.length; i++)
   {
   myP = myBodyElements[i];
   // return;
   //j=j + ' ' + (myP.id);
   // j=j + ' ' + myP.type;
   // return;
   // box = eval("document.axll." +myP.name); 
   if (  myP.id.indexOf(startstring)>-1)
      {
      // var whatit='&expanded=';
      //alert (' found 1 ' + myP.id);
      //return;
      wholething=myP.href;
      if (  wholething.indexOf(whatit)>-1)
         {
         j=j + ' ' + (myP.id);
         j=j + ',  found it ,' + myP.href;
         
         var firsta='';
         var firstb='';
         var fff;
         //alert ('wholething href=' + wholething);
         fff=wholething.indexOf(whatit);
         firsta=wholething.substr(0,fff);
         firstb=wholething.substr(fff +whatit.length);
         //alert ('firsta=' + firsta);
         //alert ('firstb=' + firstb);
         fff=firstb.indexOf('&');
         if (fff>-1)
            {
            firstb=firstb.substr(fff);
            } 
            else
            {
            firstb='';
            }
         //alert ('firstb after=' + firstb);
         wholething= firsta + firstb;
         }
     wholething=wholething+whatit + yesorno  ;  
     myP.href= wholething;
     //alert (' added parameter=' +   myP.href);
     //alert (' set ' + myP.id + ' to ' + whatit +yesorno);
     }
   }  
   
 //alert (j);
}

 


 
 function getXMLHttp()
  {

  // alert ("hi");
    var XMLHttp = null;

  if (window.XMLHttpRequest)
     {
     try 
       {

       XMLHttp = new XMLHttpRequest();
        }
    catch (e)
       {
       }

    }
   else
     if (window.ActiveXObject)
      {
      try
         {
         XMLHttp = new ActiveXObject("Msxml2.XMLHTTP");
      
    }
         catch (e)
         {

         try 
          {
        XMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
  
           }
         catch (e) { 
         }

     }

  }

 // alert ("still ok hi");
 return XMLHttp;

}






function handlerFunction() 
  {
 
  if (XMLHttp.readyState == 4)
    {

    // document.getElementById("loading").style.visibility = "hidden";

     //window.alert("Returned data: " + XMLHttp.responseText);

    }

  }

function handlerFunction2() 
  {
 
  if (XMLHttp.readyState == 4)
    {

    // document.getElementById("loading").style.visibility = "hidden";

     window.alert("Returned data: " + XMLHttp.responseText);

    }

  }



 function nt(theparm)
   {
 
   XMLHttp.open("GET", theparm);

   XMLHttp.onreadystatechange = handlerFunction;
 
   XMLHttp.send(null);
 
   }



 function process_parms(parmname,elementname,checkuncheck,data_to_add_delete)

{
//alert (elementname);
//return;
  box = document.getElementById(elementname); 
 // box = eval("document.axll." +elementname); 

// alert ("document.axll." + xxx + ".name");
if (box.checked == false)
  {
  // alert ('box is unchecked');
  ischecked ='uncheck';
  process_the_parm(parmname,data_to_add_delete,'remove'); 
  }
  else
  {
  // alert ('box is checked');
  ischecked ='check';
  //return;
  process_the_parm(parmname,data_to_add_delete,'add');
  }
if (checkuncheck == 'check')
  {
  // alert ('box is checked');
  ischecked ='check';
  }
if (checkuncheck == 'uncheck')
  {
  // alert ('box is unchecked');
  ischecked ='uncheck';
  }
  
return;

}



function process_the_parm(parmname,data_to_add_delete,add_remove)
{
var saveaction='';
var buildparm=''; 
var newparm ='';
var restparm=''; 
var restparm2='';
t = document.getElementById(formname); 
action_string=t.action;
// alert ('action string=' + action_string);
// alert ('parmname=' + parmname);
//return;
if (action_string.indexOf('&' + parmname)==-1) 
  {
  newparm='&' + parmname + '=';
  saveaction=action_string;
  //alert ('newparm=' + newparm);
  // action_string= action_string + buildparm;
  }
  else
  {
  var ij=0;
  ij=action_string.indexOf('&' + parmname);
  buildparm=action_string.substring(ij);
 //  alert ('buildparm here is ' + buildparm);
  saveaction=action_string.substring(0,ij);
  // alert ('saveaction here is ' + saveaction);
  // return;
  var aj=0;
  var ajj='';
  ajj='&' + parmname + '=';
  newparm=buildparm.substring(0,ajj.length)
  restparm=buildparm.substring(ajj.length);
  // alert ('newparm=' + newparm);
  // alert ('restparm=' + restparm);
  // return;
  ajj='&';
  aj=restparm.indexOf(ajj);
  if (aj>-1) 
    {
    restparm2=restparm.substring(aj+1);   
    restparm=restparm.substring(0,aj);
    }
  }
//alert ('restparm='+restparm);
//return;
//alert('data_to_add_delete=' + data_to_add_delete) ;
if (restparm.indexOf(data_to_add_delete )==-1 &&  add_remove=='add')
   {
   buildparm=newparm + restparm +data_to_add_delete +restparm2;
   //alert ("buildparm=" + buildparm);
   //document.axll.form1.action= saveaction + buildparm;
   //return;
     // come back here
  }
// alert ('restparm here is=' + restparm);
// alert ('data_to_add_delete  is=' + data_to_add_delete );
if (restparm.indexOf(data_to_add_delete )>-1 && add_remove=='remove')
  {
  // alert ('found data_to_add_delete  is=' + data_to_add_delete );
  ij=restparm.indexOf(data_to_add_delete);
  //alert('ij=' + ij);
  //alert('trim name=' + data_to_add_delete);
  
  var save1='';
  var save2='';
  save1=restparm.substring(0,ij);
  save2=restparm.substring(ij+data_to_add_delete.length);
 //  alert ('save1=' + save1);
  // alert ('save2=' + save2);
  restparm=save1 + save2;
  if (restparm.length==0) 
    { newparm='';}
  // alert ('restparm.length is' + restparm.length);

 //  alert ('restparm after removing item=' + restparm);
   
  buildparm=newparm + restparm  +restparm2;
 //  alert ('buildparm after=' + buildparm);
 
  }
 
// alert ('saveaction is=' + saveaction );
t = document.getElementById(formname); 
t.action= saveaction + buildparm;
// alert ('new action1 is=' + t.action);

t = document.getElementById("form2"); 
t.action= saveaction + buildparm;
// document.axll.form1.action= saveaction + buildparm;
// document.axll.form2.action= saveaction + buildparm;
  
//  alert ('new action1 is=' + t.action);
}



function dd11() {
// alert ("check worked : " + "hi");
t = document.getElementById('detailsonly3'); 
t.value=false;
// window.document.axll["detailsonly3"].value="false";
t = document.getElementById('detailsonly221'); 
// if (window.document.all["detailsonly221"].checked)
if (t.checked)
{
// alert ("it is checked : " + "hi");
t = document.getElementById('detailsonly3'); 
t.value="True";
// window.document.axll["detailsonly3"].value="True";
}
changenodetails();
} 

 


function ee11() {
var istrue;
// alert ("check worked : " + "hi");
t = document.getElementById('expanded3'); 
t.value="False";
window.document.axll["expanded3"].value="False";
istrue='false';
t = document.getElementById('expanded221'); 
// if (window.document.axll["expanded221"].checked)
if (t.checked)
{
// alert ("it is checked : " + "hi");
t = document.getElementById('expanded3'); 
t.value="True";
// window.document.axll["expanded3"].value="True";
istrue='true';
//var j;
//For Each elem In window.document.Axll;
//   j=j + ' ' + elem.id;
//     //alert elem.tagName;
    //  if(instr(elem.tagName.toLowerCase(),"xyz")>0){
    //    alert elem.tagName;
    //    }
//      Next;
}
change();
add_remove_parms('ostart','&expanded=',istrue);
//alert (j)
 
} 



 
function add_remove_parms(startstring,whatit,yesorno) {
// get a list of all the body elements (there will only be one),
// and then select the zeroth (or first) such element
//alert ('made it to add remove');
 //return;
myBody = document.getElementsByTagName("body")[0];
// now, get all the p elements that are children of the body
myBodyElements = myBody.getElementsByTagName("A");
//myBodyElements = document.getElementsById("ostart1");
//document.axll.checkall_types.checked = false;
// get the second item of the list of p elements
var i;
var j='';
var wholething='';
for  (i=0; i<myBodyElements.length; i++)
   {
   myP = myBodyElements[i];
   // return;
   //j=j + ' ' + (myP.id);
   // j=j + ' ' + myP.type;
   // return;
   // box = eval("document.axll." +myP.name); 
   if (  myP.id.indexOf(startstring)>-1)
      {
      // var whatit='&expanded=';
      //alert (' found 1 ' + myP.id);
      //return;
      wholething=myP.href;
      if (  wholething.indexOf(whatit)>-1)
         {
         j=j + ' ' + (myP.id);
         j=j + ',  found it ,' + myP.href;
         
         var firsta='';
         var firstb='';
         var fff;
         //alert ('wholething href=' + wholething);
         fff=wholething.indexOf(whatit);
         firsta=wholething.substr(0,fff);
         firstb=wholething.substr(fff +whatit.length);
         //alert ('firsta=' + firsta);
         //alert ('firstb=' + firstb);
         fff=firstb.indexOf('&');
         if (fff>-1)
            {
            firstb=firstb.substr(fff);
            } 
            else
            {
            firstb='';
            }
         //alert ('firstb after=' + firstb);
         wholething= firsta + firstb;
         }
     wholething=wholething+whatit + yesorno  ;  
     myP.href= wholething;
     //alert (' added parameter=' +   myP.href);
     //alert (' set ' + myP.id + ' to ' + whatit +yesorno);
     }
   }  
   
 //alert (j);
}

function CheckSoftware() {
    var dropdownIndex = document.getElementById('software').selectedIndex;
    var dropdownValue = document.getElementById('software')[dropdownIndex].value;
    if (dropdownValue == "Net_prospector_pro" || dropdownValue == "Net_prospector_pro" || dropdownValue == "Net_prospector_pro" || dropdownValue == "Net_prospector_pro" || dropdownValue == "Net_prospector_pro") {
//        document.getElementById("DesktopSearchSection").style.display = "none";
//        document.getElementById("SerialNumSection").style.display = "";
        document.getElementById("buildnumbertext").innerHTML = 'Version or Build Number<sup style="font-size:8px;">(1)<\/sup>:';
        if (dropdownValue == "np-pro") {
            document.getElementById("MailerSection").style.display = "block";
            document.getElementById("message").style.height = "314px";
        } else {
//            document.getElementById("MailerSection").style.display = "none";
            document.getElementById("message").style.height = "275px";
        }
    }
    else if (dropdownValue == "Net_prospector_pro" || dropdownValue == "Net_prospector_pro") {
    if (dropdownValue == "Net_prospector_pro") { document.getElementById("DesktopSearchSection").style.display = ""; } else { document.getElementById("DesktopSearchSection").style.display = "none"; }
        document.getElementById("SerialNumSection").style.display = "none";
        if (dropdownValue == "onThego") { document.getElementById("message").style.height = "318px"; } else { document.getElementById("message").style.height = "258px"; }
        document.getElementById("buildnumbertext").innerHTML = 'Connector version<sup style="font-size:8px;">(1)<\/sup>:';
    }
    else {
//        document.getElementById("DesktopSearchSection").style.display = "none";
//        document.getElementById("SerialNumSection").style.display = "none";
        document.getElementById("buildnumbertext").innerHTML = 'Version or Build Number<sup style="font-size:8px;">(1)<\/sup>:';
        if (dropdownValue == "Net_prospector_pro") {
            document.getElementById("MailerSection").style.display = "block";
            document.getElementById("message").style.height = "275px";

        } else {
//            document.getElementById("MailerSection").style.display = "none";
            document.getElementById("message").style.height = "240px";
        }
    }
}


function ValidForm() {
    var is_complete = true;
    var error_msg = '';
    var noSoft;

    Form = document.forms['form1'];

    if (Form.elements.support_name.value.length == 0) {
        if (is_complete) {
            error_msg = 'User name blank,';
            Form.elements.support_name.focus(); is_complete = false;
        }
    }

    if (Form.elements.support_email.value.length == 0) {
        if (is_complete) {
            error_msg = 'Email address blank,';
            Form.elements.support_email.focus(); is_complete = false;
        }
    }

//    if (!ValidEmail(Form.elements.support_email.value)) {
//        if (is_complete) {
//            error_msg = 'CONST_ERROR_IN_FIELD_EMAIL';
//            Form.elements.support_email.focus(); is_complete = false;
//        }
//    }

    if (Form.elements.support_software.selectedIndex == 0) {
        if (is_complete) {
            error_msg = 'Software not selected,';
            Form.elements.support_software.focus(); is_complete = false;
        }
    }

    noSoft = Form.elements.software.selectedIndex;
//    if (Form.elements.support_serial.value.length == 0 && (noSoft == 2 || noSoft == 3 || noSoft == 5 || noSoft == 8 || noSoft == 9)) {
//        if (is_complete) {
//            error_msg = 'CONST_ERROR_SERIAL';
//            Form.elements.support_serial.focus(); is_complete = false;
//        }
//    }

    noSoft = Form.elements.software.selectedIndex;
//    if (Form.elements.support_desktopsearch.value.length == 0 && noSoft == 11) {
//        if (is_complete) {
//            error_msg = "Please select the program!";
//            Form.elements.support_desktopsearch.focus(); is_complete = false;
//        }
//    }

    noSoft = Form.elements.software.selectedIndex;
//    if (Form.elements.support_desktopsearchversion.value.length == 0 && noSoft == 11) {
//        if (is_complete) {
//            error_msg = 'CONST_ERROR_BUILD_DESKTOPSEARCH';
//            Form.elements.support_desktopsearchversion.focus(); is_complete = false;
//        }
//    }

    if (Form.elements.support_version.value.length == 0) {
        if (is_complete) {
            error_msg = 'Build level of software not supplied.';
            Form.elements.support_version.focus(); is_complete = false;
        }
    }

    if (Form.elements.support_os.selectedIndex == 0) {
        if (is_complete) {
            error_msg = 'Operating system not supplied.';
            Form.elements.support_os.focus(); is_complete = false;
        }
    }

    if (Form.elements.support_browser.selectedIndex == 0) {
        if (is_complete) {
            error_msg = 'browser version not supplied.';
            Form.elements.support_browser.focus(); is_complete = false;
        }
    }

    if (Form.elements.support_firewall.selectedIndex == 0) {
        if (is_complete) {
            error_msg = 'Firewall usage not supplied.';
            Form.elements.support_firewall.focus(); is_complete = false;
        }
    }

    if (Form.elements.support_firewall.selectedIndex == 1 && Form.elements.firewallname.value.length == 0) {
        if (is_complete) {
            error_msg = 'Firewall name not supplied.';
            Form.elements.support_firewallname.focus(); is_complete = false;
        }
    }

    if (Form.elements.support_shortdesc.value.length == 0) {
        if (is_complete) {
            error_msg = 'Short description of problem not supplied.';
            Form.elements.support_shortdesc.focus(); is_complete = false;
        }
    }

    if (Form.elements.support_reproduce.selectedIndex == 0) {
        if (is_complete) {
            error_msg = 'Frequency of error not supplied.';
            Form.elements.support_reproduce.focus(); is_complete = false;
        }
    }

    if (Form.elements.support_description.value.length == 0) {
        if (is_complete) {
            error_msg = 'Description is empty.';
            Form.elements.support_description.focus(); is_complete = false;
        }
    }

    if (error_msg.length > 0) { alert(error_msg); }
    return is_complete;
}




function affiliate_ValidForm() {
    var is_complete = true;
    var error_msg = '';
    var noSoft;

    Form = document.forms['form1'];

    if (Form.elements.regnow_affiliate_id.value.length == 0) {
        if (is_complete) {
            error_msg = 'Regnow affiliate id blank,';
            Form.elements.regnow_affiliate_id.focus(); is_complete = false;
        }
    }

   

    if (error_msg.length > 0) { alert(error_msg); }
    return is_complete;
}




 
