// script by Joe Maller
// JavaScripts available at http://www.joemaller.com
// this script is free to use and distribute
// but please credit me and/or link to my site
function WriteContact(who, at, tag, itemClass) {
  var myvar = who + '@' + at;
  document.write('<a href="mai' + 'lto:' + myvar+ '" '+(itemClass=='' ? '' : 'class=\"'+itemClass+'\"')+'>' + tag + '</a>');
}

function multiLoad(doc1, doc2) {
  parent.main.location.href=doc1;
  parent.bottom.location.href=doc2;
}

function UpdateTitle(text, country, html) {
  if (html==null) html=false;
  if (typeof(swap)!="undefined" && swap==true) text+=" - Swap";
  else if (typeof(coll)!="undefined" && coll==true) text+=" - Collection";

  for(var i=0;i<window.parent.frames.length;i++) {
    if (window.parent.frames[i].name=='top') {
      if (typeof(parent.frames(i).t)!='undefined') {
        if (html) {
  		  parent.frames(i).t.innerHTML='<img src="'+country+'/flag-'+country+'.gif" alt="'+country+' flag" width="30" height="20" />&nbsp;'+text+'&nbsp;<img src="'+country+'/flag-'+country+'.gif" alt="'+country+' flag" width="30" height="20" />';
	    }
	    else {
		  parent.frames(i).t.innerText=text;
	    }
	  }
 	}
  }
}

function right(e) {
  if ( navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2) )
	return false;
  else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3) ) {
	alert("Enjoy ...");
	return false;
  }
  return true;
}

function OpenSongsList(singer, type) {
  var w, h;
  if (type=='S') {
    w=250;
    h=200;
  }
  else {
    w=350;
    h=200;
  }
  window.open('downloads/'+singer+'.asp',null,'left=100,height='+h+',top=100,width='+w+',scrollbars=auto')
}

function openIAmp(){
	newwin = window.open('/iamp/play.html','IAMP','toolbar=no,location=no,menubar=no,scrollbars=no,width=255,height=118');
}

function addText(input,insText) {
 input.focus();
 if(input.createTextRange) { //IE
   document.selection.createRange().text += insText
 } else if(input.setSelectionRange) { //MOZ
   var len = input.selectionEnd
   input.value=input.value.substr(0,len) + insText + input.value.substr(len)
   input.setSelectionRange(len+insText.length, len+insText.length)
 } else { alert('oops')}
}