
if (window.addEventListener) {
   document.addEventListener('mouseover', MouseOutExe,false);
   window.addEventListener("load", initializemarquee, false);
}
else if (window.attachEvent) {
  document.attachEvent('onmouseover', MouseOutExe);
  window.attachEvent("onload", initializemarquee);
}
else if ($) {
  window.onload = MouseOutExe;
  window.onload = initializemarquee;
}
function MouseOutExe(e) {
  e = Event.element(e);
  if ( (e.id == 'spn_logo_options') || (e.parentNode.id == 'spn_logo_poped') || (e.id == 'spn_logo_poped') || (e.parentNode.id == 'more_gadgets')  ) {
	 if (!$('spn_logo_poped') &&  !$('sendtofrnd') ) {
	   // get the gadgets id
	   var urll = location.href.split('=');
	   gid = urll[1];
	   // get the spn logo position
	   var spnpos = Position.cumulativeOffset($('spn_logo_options'));
	   p = document.createElement('div');
	   p.id = 'spn_logo_poped';
	   p.className = 'spn_logo_class';
	   Element.setStyle(p,{zIndex:1000,position:'absolute',top:spnpos[1]- 45+'px',left:spnpos[0]-53+'px',display:'none'});
	   var rexp = new RegExp("import-ajax","g");
       if (location.href.match(rexp))  {  // check it that from where the request coming in either from own site or from another
	      p.innerHTML = '<div id="more_gadgets" style="border-bottom:1px solid #4B6971;cursor:pointer;text-align:left;padding-left:2px;color:#2B8CB4;height:15px;" onmouseover="javascript:$(\'more_gadgets\').style.backgroundColor=\'#98DEFD\';" onmouseout="javascript:$(\'more_gadgets\').style.backgroundColor=\'#FEFEFE\';"><a href="http://www.smartwebgadgets.com/get-gadgets.php?id='+gid+'" target="_blank" style="color:#2B8CB4; text-decoration:none;"><img src="http://www.smartwebgadgets.com/gad_image/circle.gif" border="0" />&nbsp;Add to My Site</a></div><div id="sendtofriend" style="border-bottom:1px solid #4B6971;cursor:pointer;text-align:left;padding-left:2px;;color:#2B8CB4;height:15px;" onclick="javascript:send_to_frnd('+gid+'); return false;" onmouseover="javascript:$(\'sendtofriend\').style.backgroundColor=\'#98DEFD\';" onmouseout="javascript:$(\'sendtofriend\').style.backgroundColor=\'#FEFEFE\';"><img src="http://www.smartwebgadgets.com/gad_image/sndfrnd.gif" border="0" >&nbsp;Send to Friend</div><div id="help" style="cursor:pointer;text-align:left;padding-left:2px;;color:#2B8CB4;height:15px;" onmouseover="javascript:$(\'help\').style.backgroundColor=\'#98DEFD\';" onmouseout="javascript:$(\'help\').style.backgroundColor=\'#FEFEFE\';"><a href="http://www.smartwebgadgets.com/get-gadgets.php?id='+gid+'" target="_blank" style="color:#2B8CB4; text-decoration:none;"><img src="http://www.smartwebgadgets.com/gad_image/question.gif" border="0" >&nbsp;Help</a></div>'; 
	   }
	   else { 
	      p.innerHTML = '<div id="more_gadgets" style="border-bottom:1px solid #4B6971;cursor:pointer;text-align:left;padding-left:2px;color:#2B8CB4;height:15px;" onmouseover="javascript:$(\'more_gadgets\').style.backgroundColor=\'#98DEFD\';" onmouseout="javascript:$(\'more_gadgets\').style.backgroundColor=\'#FEFEFE\';" onclick="javascript:get_gadgets('+gid+'); return false;"><img src="http://www.smartwebgadgets.com/gad_image/circle.gif" border="0" />&nbsp;Add to My Site</div><div id="sendtofriend" style="border-bottom:1px solid #4B6971;cursor:pointer;text-align:left;padding-left:2px;;color:#2B8CB4;height:15px;" onclick="javascript:send_to_frnd('+gid+'); return false;" onmouseover="javascript:$(\'sendtofriend\').style.backgroundColor=\'#98DEFD\';" onmouseout="javascript:$(\'sendtofriend\').style.backgroundColor=\'#FEFEFE\';"><img src="http://www.smartwebgadgets.com/gad_image/sndfrnd.gif" border="0" >&nbsp;Send to Friend</div><div id="help" style="cursor:pointer;text-align:left;padding-left:2px;;color:#2B8CB4;height:15px;" onmouseover="javascript:$(\'help\').style.backgroundColor=\'#98DEFD\';" onmouseout="javascript:$(\'help\').style.backgroundColor=\'#FEFEFE\';" onclick="javascript:get_gadgets('+gid+'); return false;"><img src="http://www.smartwebgadgets.com/gad_image/question.gif" border="0" >&nbsp;Help</div>';
	   }
		
		document.body.appendChild(p);
	    new Effect.toggle('spn_logo_poped','appear',{duration:0.5});
	 }
  }
  else { 
	 if ($('spn_logo_poped') ) 
	   new Effect.toggle('spn_logo_poped','appear',{duration:0.5,afterFinishInternal:function(){$('spn_logo_poped').remove();}});
	   //$('spn_logo_poped').remove();
  }
} // end function

function showoptions(obj) { 
  if (obj.value == 1) { 
     $('bpr_index5').innerHTML = '<div class="bpr_main-text" style="display:block;"><dl class="dls"><dd>Find out how many backlinks your site has in the major search engines. To learn more visit: <a href="http://www.buildpr.com" target="_blank">www.buildpr.com</a></dd><dd><strong>Enter your URL:</strong></dd><dd><input type="text" value="http://www." class="bpr_textbox" id="bbbc" /><br />(ex:  www.yourdomain.com)</dd><dd><input style="padding-left:30px;" type="image" src="http://www.smartwebgadgets.com/gad_image/bpr_gen_rep.gif" onclick="javascript:get_buildpr_result(\'bbbc\');" /></dd></dl></div>';
  }
  else if (obj.value == 2) { 
     $('bpr_index5').innerHTML = '<div class="bpr_main-text" style="display:block;"><dl class="dls" style="padding:0px;margin:0px;line-height:15px;"><dd>Check if your keyword(s) are found within the first 5 pages of the major search engines. To learn more visit: <a href="http://www.buildpr.com" target="_blank">www.buildpr.com</a></dd><dd><strong>Enter A Keyword/Phrase:</strong></dd><dd><input  type="text" value="" class="bpr_textbox" id="kpc" /></dd><dd><strong>Enter Url:(ex:  www.yourdomain.com)</strong></dd><dd><input type="text" value="" class="bpr_textbox" id="kpcurl" /></dd><dd><input type="image" style="padding-left:30px;margin-top:3px;" src="http://www.smartwebgadgets.com/gad_image/bpr_gen_rep.gif" onclick="javascript:get_buildpr_result(\'kpc\');" /></dd></dl></div>'; 
  
  } 
  else if (obj.value == 3) { 
     $('bpr_index5').innerHTML = '<div class="bpr_main-text"  style="display:block;"><dl class="dls"><dd>Check how many pages the search engines see your site has. To learn more visit: <a href="http://www.buildpr.com" target="_blank">www.buildpr.com</a></dd><dd><strong>Enter your URL:</strong></dd><dd><input type="text" value="http://www." class="bpr_textbox" id="sesc" /><br />(ex:  www.yourdomain.com)</dd><dd><input style="padding-left:30px;" type="image" src="http://www.smartwebgadgets.com/gad_image/bpr_gen_rep.gif" onclick="javascript:get_buildpr_result(\'sesc\');" /></dd></dl></div>';
  
  }
  else if (obj.value == 4) { 
     $('bpr_index5').innerHTML = '<div class="bpr_main-text"  style="display:block;"><dl class="dls"><dd>Find out how many Blog And BookMarks your site has in the major search engines. To learn more visit: <a href="http://www.buildpr.com" target="_blank">www.buildpr.com</a></dd><dd><strong>Enter your URL:</strong></dd><dd><input type="text" value="" class="bpr_textbox" id="bookblog" /><br />(ex:  www.yourdomain.com)</dd><dd><input style="padding-left:30px;" type="image" src="http://www.smartwebgadgets.com/gad_image/bpr_gen_rep.gif" onclick="javascript:get_buildpr_result(\'bookblog\');" /></dd></dl></div>'; 
  
  }
  else { 
     $('bpr_index5').innerHTML = '<div class="bpr_main-text"  style="display:block;"><dl class="dls"><dd>Find out what your site ranks with Google and Alexa! To learn more visit: <a href="http://www.buildpr.com" target="_blank">www.buildpr.com</a></dd><dd><strong>Enter your URL:</strong></dd><dd><input type="text" class="bpr_textbox" id="pr" /><br />(ex:  www.yourdomain.com)</dd><dd><input style="padding-left:30px;" type="image" src="http://www.smartwebgadgets.com/gad_image/bpr_gen_rep.gif" onclick="javascript:get_buildpr_result(\'pr\');" /></dd></dl></div>'; 
  }
 
}

function get_buildpr_result(type) { 
  if (type == 'kpc')
    var parms = 'type='+type+'&keyword='+$(type).value+'&value='+$('kpcurl').value;  
  else
    var parms = 'type='+type+'&value='+$(type).value;
	
  $('bpr_index5').innerHTML = '<span class="bpr_main-text"><img src="http://www.smartwebgadgets.com/images/indicator.gif" border="0" />...Searching for Result...Please Wait....<img src="http://www.smartwebgadgets.com/images/indicator.gif" border="0" /></span>';
  new Ajax.Request('http://www.smartwebgadgets.com/get-buildpr-data.php',{method:'post', parameters: parms, onComplete: bprreq});
}
function bprreq(req) { 
  $('bpr_index5').innerHTML = req.responseText;
}







