var vendorSE = '';
var url = "";

function disableButtons(){
   document.mainform.phaseGoogleBtn.disabled=true;
   document.mainform.phaseBingBtn.disabled=true;     
   document.mainform.phaseYahooBtn.disabled=true;
}

function enableButtons(){
   document.mainform.phaseGoogleBtn.disabled=false;
   document.mainform.phaseBingBtn.disabled=false;     
   document.mainform.phaseYahooBtn.disabled=false;
}

function getRadioValue()
{
for (var i=0; i < document.mainform.resultLimit.length; i++)
   {
   if (document.mainform.resultLimit[i].checked)
      {
      return document.mainform.resultLimit[i].value;
      }
   }
}


function stepOne(vendor) {
   vendorSE = vendor;

   var item = document.mainform.keyword.value;

   if((item == null) || (item == "")) return;

   if(vendor =='google') {
      url = 'http://localhost:10000/kwdb/gParser.php?keyword=' + escape(document.mainform.keyword.value) + '&resultLimit=' + getRadioValue() + '&' ;
      document.getElementById('responsedivgoogle').src= url;
      //setTimeout("resizeG()",3000);       
   } else {
      if(vendor =='yahoo') {
        url = 'http://localhost:10000/kwdb/yParser.php?keyword=' + escape(document.mainform.keyword.value) + '&resultLimit=' + getRadioValue() + '&' ;
      document.getElementById('responsedivyahoo').src= url;
        //setTimeout("resizeY()",3000);       
      } else {
         url = 'http://localhost:10000/kwdb/bParser.php?keyword=' + escape(document.mainform.keyword.value) + '&resultLimit=' + getRadioValue() + '&' ;
      document.getElementById('responsedivbing').src= url;
         //setTimeout("resizeB()",3000);       
      }
   }
}
function preloadinstructions() {
   url = 'http://localhost:10000/kwdb/instructions.txt';
   document.getElementById('detailsframe').src= url;
}
var IE = /*@cc_on!@*/false;


function resizeG(){
if(IE){
document.getElementById("responsedivgoogle").style.height=300;
}else{
   height = document.getElementById('responsedivgoogle').contentDocument.body.scrollHeight;
   document.getElementById('responsedivgoogle').style.height = height;
}

}

var bhack = 1;
function resizeB(){
if(IE){
document.getElementById("responsedivbing").style.height=300;
}else{
   height = document.getElementById('responsedivbing').contentDocument.body.scrollHeight;
   document.getElementById('responsedivbing').style.height = height;
   if(bhack<10){
     setTimeout("resizeB()",4000);       
     bhack++;
   }
}

}

function resizeY(){
if(IE){
document.getElementById("responsedivyahoo").style.height=300;
}else{
   height = document.getElementById('responsedivyahoo').contentDocument.body.scrollHeight;
   document.getElementById('responsedivyahoo').style.height = height;
}

}