function makePlayerButton(songURL, size){

objectHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,47,0" width="'+size+'" height="'+size+'" id="wimpy_button_96516" name="wimpy_button_96516">';

objectHTML += '<param name="movie" value="/3rd/wimpy/wimpy_button.swf?theFile='+songURL+'"/>';
objectHTML += '<param name="quality" value="high"/><param name="bgcolor" value="#6A7A95"/><param name="wmode" value="transparent" />';

objectHTML += '<embed src="/3rd/wimpy/wimpy_button.swf?theFile='+songURL+'" width="'+size+'" height="'+size+'" quality="high" bgcolor="#6A7A95" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"  name="wimpy_button_96516" /></object>';

document.write(objectHTML);
}

function makeWMPlayer(songURL, autoPlay){

objectHTML = '<OBJECT id="VIDEO" style="width:420px; height:45px" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject">';

objectHTML += '<PARAM NAME="URL" VALUE='
objectHTML += '"' + songURL + '" ref>';
objectHTML += '<PARAM NAME="AutoStart" VALUE="true"> ';
objectHTML += '<PARAM name="uiMode" value="full">';
objectHTML += '<PARAM name="PlayCount" value="1">';
objectHTML += '<param name="rate" value="1">';
objectHTML += '<param name="balance" value="0">';
objectHTML += '<param name="currentPosition" value="0">';
objectHTML += '<param name="defaultFrame" value>';
objectHTML += '<param name="currentMarker" value="0">';
objectHTML += '<param name="invokeURLs" value="-1">';
objectHTML += '<param name="baseURL" value>';
objectHTML += '<param name="volume" value="50">';
objectHTML += '<param name="mute" value="0">';
objectHTML += '<param name="stretchToFit" value="0">';
objectHTML += '<param name="windowlessVideo" value="0">';
objectHTML += '<param name="enabled" value="-1">';
objectHTML += '<param name="enableContextMenu" value="-1">';
objectHTML += '<param name="fullScreen" value="0">';
objectHTML += '<param name="SAMIStyle" value>';
objectHTML += '<param name="SAMILang" value>';
objectHTML += '<param name="SAMIFilename" value>';
objectHTML += '<param name="captioningID" value>';
objectHTML += '<param name="enableErrorDialogs" value="0">';

objectHTML += '<EMBED type="application/x-mplayer2" ';
objectHTML += 'height="70" ';
objectHTML += 'width="420" ';
objectHTML += 'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" ';
objectHTML += 'id="mediaPlayer" name="mediaPlayer" ';
objectHTML += 'bgcolor="#000000" ';
objectHTML += 'showcontrols="false" ';
objectHTML += 'showaudiocontrols="false" ';
objectHTML += 'showtracker="-1" ';
objectHTML += 'showdisplay="0" showstatusbar="1" videoborder3d="-1" ';
objectHTML += 'enabletracker="true" ';
objectHTML += 'src="' + songURL + '" ';
objectHTML += 'url="' + songURL + '" ';
objectHTML += 'autostart="' + autoPlay + '" ';
objectHTML += 'designtimesp="5311" ';
objectHTML += ' loop="false"></EMBED>';

objectHTML += '</OBJECT>';

document.write(objectHTML);
}
function textCounter(field,counter,maxlimit,linecounter) {
	// text width//
	var fieldWidth =  parseInt(field.offsetWidth);
	var charcnt = field.value.length;        

	// trim the extra text
	if (charcnt > maxlimit) { 
		field.value = field.value.substring(0, maxlimit);
	}

	else { 
	// progress bar percentage
	var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit) ;
	document.getElementById(counter).style.width =  parseInt((fieldWidth*percentage)/100)+"px";
	document.getElementById(counter).innerHTML="Limit: "+percentage+"%"
	// color correction on style from CCFFF -> CC0000
	setcolor(document.getElementById(counter),percentage,"background-color");
	}
}

function setcolor(obj,percentage,prop){
	obj.style[prop] = "rgb(80%,"+(100-percentage)+"%,"+(100-percentage)+"%)";
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}