var alldivs = ['convertnow','crossrateshow','convertresult'];
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')  ) {
	 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';
	   document.body.appendChild(p);
	   Element.setStyle(p,{zIndex:3000,position:'absolute',top:spnpos[1]- 47+'px',left:spnpos[0]-56+'px',display:'none'});
	   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>'; 
	   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 converfromto() { 
  var amt = $('amt').value;
  var from = $('from').value;
  var to = $('to').value;
  if ( (amt == null) || (amt == '') ) return false;
  $('convertnow').style.display = 'none';
  $('crossrateshow').style.display = 'none';
  $('convertresult').style.display = 'block';
  $('convertresult').innerHTML = '<span class="blue-txt"><img src="http://www.smartwebgadgets.com/images/indicator.gif" border="0" />...Processing...Please Wait....<img src="http://www.smartwebgadgets.com/images/indicator.gif" border="0" /></span>';
  var parms = 'amt='+amt+'&from='+from+'&to='+to;  
  new Ajax.Request('http://www.smartwebgadgets.com/currency-convert.php',{method:'post',parameters: parms, onComplete: convertstatus});
}
function convertstatus(oreqq) { 
  $('convertresult').innerHTML = oreqq.responseText;
}

var imga = document.createElement('img');
var imgb = document.createElement('img');
imga.src = "http://www.smartwebgadgets.com/gad_image/21.gif";
imgb.src = "http://www.smartwebgadgets.com/gad_image/22.gif";

function showtab(tabname,obj) {

  var shownow = tabname;
  for (var i=0; i<alldivs.length; i++ ) { 
		 if (alldivs[i] != tabname) {
		    if(alldivs[i] != '')
			  $(alldivs[i]).style.display = 'none';
		 }
  }
  $(tabname).style.display = 'block';
  
  if (obj == 'current') { 
     $('current').className = 'lstd-11';
	 $('cross').className = 'lstd-12';
  }
  else {
     $('current').className = 'lstd-21';
	 $('cross').className = 'lstd-22';
	  
  }
}
