var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e)
	{
	var keyCode = (isNN) ? e.which : e.keyCode; 
	var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
	if(input.value.length >= len && !containsElement(filter,keyCode))
		{
		input.value = input.value.slice(0, len);
		input.form[(getIndex(input)+1) % input.form.length].focus();
		input.form[(getIndex(input)+1) % input.form.length].select();
		
		}
function containsElement(arr, ele)
	 {
	var found = false, index = 0;
	while(!found && index < arr.length)
		if(arr[index] == ele)
		found = true;
		else
		index++;
		return found;
		}
function getIndex(input)
	 {
	var index = -1, i = 0, found = false;
	while (i < input.form.length && index == -1)
	if (input.form[i] == input)index = i;
	else i++;
	return index;
	}
return true;
}


function eztracks(id)
	{
	var url = "http://www.ez-tracks.com/getsong.html?songid=" + songId + "&refer=slidedelicdl";
	window.open(url,null,"height=600,width=800,scrollbars=yes,status=yes,toolbar=yes,menubar=yes,location=yes, resizable=yes, titlebar=yes");
	}

function getSongs(bizid)
	{
		
	if(bizid == 725)
		{
		var url = "http://www.getMusicFree.com/getsong.html?songid=" + songId + "&refer=slidedelicdl";
		}
	else
		{
		var url = "http://www.ez-tracks.com/getsong.html?songid=" + songId + "&refer=slidedelicdl";
		}
	window.open(url,null,"height=600,width=800,scrollbars=yes,status=yes,toolbar=yes,menubar=yes,location=yes, resizable=yes, titlebar=yes");
	}

function getSongs2(bizid)
	{
	var url = "http://www.massivemp3giveaway.com/getsong.html?songid=" + songId + "&refer=slidedelicdl";
	window.open(url,null,"height=600,width=800,scrollbars=yes,status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes,titlebar=yes,scrollbars=1");
	}


function ringtone()
	{
	no = document.getElementById('area').value + document.getElementById('pre').value + document.getElementById('suf').value;
	
	t = IsNumeric(no);
	if(t == false)
		{
		alert('Please enter a valid cellphone number.');
		return false;
		}
		var url = 'http://eztracks.aavalue.com/?flowtoUse=294&refer=slidecellsubmit&cellphone=' + no;
		window.open(url,null);
	//var url = 'http://thumbplay.aavalue.com/?referrer_id=1149299&Cellphone=' + no;
	//window.open(url,null,"height=500,width=700,status=yes,toolbar=yes,menubar=yes,location=yes, resizable=yes, titlebar=yes");
	}

function IsNumeric(strString)
  {
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

  for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }
