
function bookmark_us(url, title){
  if (window.sidebar) // firefox
      window.sidebar.addPanel(title, url, "");
  else if(window.opera && window.print){ // opera
      var elem = document.createElement('a');
      elem.setAttribute('href',url);
      elem.setAttribute('title',title);
      elem.setAttribute('rel','sidebar');
      elem.click();
  }
  else if(document.all)// ie
      window.external.AddFavorite(url, title);
}

function check_form () {		
		var form = document.forms['f'];

		tmp = form.elements['email'];
		if ((tmp.value.length == 0) || (tmp.value.search(/^[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*@[0-9a-zA-Z_]([-\.]?[0-9a-zA-Z_])*\.[a-zA-Z]{2,4}$/) == -1 )) {
			alert ('Incorrect or empty Email');
			tmp.focus ();
			return false;
		}
	    return true;
}
	
function printCurrency() {
    var iMyWidth;
    var iMyHeight;
    iMyWidth = (window.screen.width/2) - 300;
    iMyHeight = (window.screen.height/2) - 300;
    var win2 = window.open('print.php',"print","status,height=540,width=620,resizable=no,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight+" ,scrollbars=no");
    win2.focus();
}

function writeSelling(){
  document.write("<select name=\"currencyid\" class=\"instant-Rates\"  onchange=\"convert(document.f1.amount.value, document.f1.currencyid.options[document.f1.currencyid.selectedIndex].value, \'WEBUY\', \'b1\');\">");
  document.write( listCurrencyOptions('USD') );
  document.write("</select>");
}

function writeBuying(){
  document.write("<select name=\"currencyids\" class=\"instant-Rates\"  onchange=\"convert(document.f2.amount.value, document.f2.currencyids.options[document.f2.currencyids.selectedIndex].value, \'WESELL\', \'b2\');\">");
  document.write( listCurrencyOptions('USD') );
  document.write("</select>");
}

function showSendFriend(){
	var iMyWidth;
	var iMyHeight;
	iMyWidth = (window.screen.width/2) - (250 + 10); 
	iMyHeight = (window.screen.height/2) - (250 + 50); 
	document.getElementById("sendfriend").style.left=iMyWidth+'px';
	document.getElementById("sendfriend").style.top=iMyHeight+'px';
	document.getElementById("sendfriend").style.visibility='visible';	
}	
