var w,num_cal;
bName = navigator.appName;
bVer = parseInt(navigator.appVersion);
var isCSS, isW3C, isIE4, isNN4, isIE6CSS;

if ((bName == "Netscape" && bVer >= 3) || (bName == "Microsoft Internet Explorer" && bVer >=4)) 
	br = "n3";
else 
	br = "n2";

if (br == "n3")
{
	img1on = new Image();
	img1on.src = "../img/enter-b.gif";	
	img2on = new Image();
	img2on.src = "../img/register-b.gif";

	img1off = new Image();
	img1off.src = "../img/enter-a.gif";	
	img2off = new Image();
	img2off.src = "../img/register-a.gif";
}
function imgAct(imgName){
	if (br == "n3")
	{
		document[imgName].src = eval(imgName + "on.src");
	}
}
function imgInact(imgName)
{
	if (br == "n3")
	{
		document[imgName].src = eval(imgName + "off.src");
	}
}
function buttonAct(item,imgName){
	if (br == "n3"){
		item.src = eval(imgName + "on.src");
	}
}
function buttonInact(item,imgName){
	if (br == "n3"){
		item.src = eval(imgName + "off.src");
	}
}
function menuItemColor(item,img,path)
{
	resetItems();
	item.style.color = "#FF7900";
	img.src = path;
}
function resetItems()
{
	AboutUsLink.style.color = "#000000";
	TestimonialsLink.style.color = "#000000";
	FaqLink.style.color = "#000000";
	ContactLink.style.color = "#000000";
}
function hideItem(nameItem)
{
	var img = document.getElementById(nameItem);
	if(img != null)
		img.style.display = "none";
	/*if(item != null)
	{
		item.style.display = "none";
	}*/
}
function changeImg(img, path)
{
	img.src = path;
}
function onlyNumbers(i) {
	if(i.value.length>1) {
		i.value = i.value.replace(/[^-?]?[^\d]$/, '');
	}
	else{
		if(i.value.length>0)
		{
			i.value = i.value.replace(/[^\d|-]$/, '');
		}
	}
}
function onlyPositiveNumber(i) {
	if(i.value.length>0)
	{
		i.value = i.value.replace(/[^\d]$/, '');
	}
}

function onlyLetters(i){
	if(i.value.length>0)
	{
			i.value = i.value.replace(/[^a-zA-Z]$/, '');
	}

}
function wopen(Url,Title,Settings)
{
	w = w=window.open(Url, Title,Settings);
	w.focus();
}

//displays the player payment boxes
//*******************************************************
/*function player(cid)
{
	clearTable(cid);

	var tbody = document.getElementById(cid).getElementsByTagName("TBODY")[0];
	var row = document.createElement("TR");
	var t1 = document.createElement("TD");
	var t2 = document.createElement("TD");

	//the player account id row
	t1.innerHTML='<span class="txt">Player ID *</span>&nbsp;&nbsp;'
	t2.innerHTML='<input cols="25" class="txt2" name="PlayerID"></input>'
	//apend the columns to the row
	row.appendChild(t1)
	row.appendChild(t2)

	//apend the rows to the table
	tbody.appendChild(row)

}
//display the neteller payment boxes
//*******************************************************
function neteller(cid)
{
	clearTable(cid);

	var tbody = document.getElementById(cid).getElementsByTagName("TBODY")[0];
	var row = document.createElement("TR");
	var row2 = document.createElement("TR");
	var t1 = document.createElement("TD");
	var t2 = document.createElement("TD");
	var t3 = document.createElement("TD");
	var t4 = document.createElement("TD");

	//the account id row
	t1.innerHTML='<span class="txt">Account ID</span>&nbsp;&nbsp;'
	t2.innerHTML='<input cols="25" class="txt2" onkeypress="onlyPositiveNumber(this);" onkeyup="onlyPositiveNumber(this);" onChange="onlyPositiveNumber(this);" name="AccountID"></input>'
	//apend the columns to the row
	row.appendChild(t1)
	row.appendChild(t2)

	//the secure ID row
	t3.innerHTML='<span class="txt">Secure ID</span>&nbsp;&nbsp;'
	t4.innerHTML='<input cols="25" class="txt2" onkeypress="onlyPositiveNumber(this);" onkeyup="onlyPositiveNumber(this);" onChange="onlyPositiveNumber(this);" name="SecureID"></input>'

	//apend the columns to the row2
	row2.appendChild(t3)
	row2.appendChild(t4)
	//apend the rows to the table
	tbody.appendChild(row)
	tbody.appendChild(row2)
}*/
//clear the table with any payment boxes
//*******************************************************
function clearTable(cid)
{
	var tbody =  document.getElementById(cid)
	var row = tbody.rows.length;
	var i = 1;

	for(i = tbody.rows.length-1; i >= 0; i--)
	{
		tbody.deleteRow(i);
	}
}
//display the check boxes (none by the moment)
//********************************************************
function check(cid)
{
	clearTable(cid);
	var tbody = document.getElementById(cid).getElementsByTagName("TBODY")[0];
	var row = document.createElement("TR");
	var t1 = document.createElement("TD");
	var t2 = document.createElement("TD");
	
	//the to box
	t1.innerHTML='<span class="txt">To *</span>&nbsp;&nbsp;'
	t2.innerHTML='<textarea cols="50" style="OVERFLOW: hidden" rows="1" class="txt2" name="To" maxlength="100" onkeyup="return ismaxlength(this)">'+document.getElementById("HTo").value+'</textarea>'
	//apend the columns to the row
	row.appendChild(t1)
	row.appendChild(t2)
	
	//apend the rows to the table
	tbody.appendChild(row)
	
}
//display the wire transfer boxes
//********************************************************
/*function wireTransfer(cid)
{
	clearTable(cid);

	var tbody = document.getElementById(cid).getElementsByTagName("TBODY")[0];
	var row = document.createElement("TR");
	var row2 = document.createElement("TR");
	var row3 = document.createElement("TR");
	var t1 = document.createElement("TD");
	var t2 = document.createElement("TD");
	var t3 = document.createElement("TD");
	var t4 = document.createElement("TD");
	var t5 = document.createElement("TD");
	var t6 = document.createElement("TD");

	//the bank name row
	t1.innerHTML='<span class="txt">Bank Name *</span>&nbsp;&nbsp;'
	t2.innerHTML='<input cols="25" class="txt2" name="BankName"></input>'

	//apend the columns to the row
	row.appendChild(t1)
	row.appendChild(t2)

	//the bank address
	t3.innerHTML='<span class="txt">Bank Address *</span>&nbsp;&nbsp;'
	t4.innerHTML='<textarea cols="40"class="txt2" rows="3" name="BankAddress"></textarea>'
		
	//apend the columns to the row
	row2.appendChild(t3)
	row2.appendChild(t4)

	//the bank address
	t5.innerHTML='<span class="txt">Bank Account *</span>&nbsp;&nbsp;'
	t6.innerHTML='<input cols="25"class="txt2" name="BankAccount"></input>'

	//apend the columns to the row
	row3.appendChild(t5)
	row3.appendChild(t6)

	//apend the rows to the table
	tbody.appendChild(row)
	tbody.appendChild(row2)
	tbody.appendChild(row3)
}
//use to handle which payment method boxes to display
//********************************************************
function dropDownMenu(entered,cid)
{
	with(entered)
	{
		ref=options[selectedIndex].value;
		switch(ref)
		{
			case "1":
				check(cid);
			break;

			case "2":
				wireTransfer(cid);
			break;

			case "3":
				neteller(cid);
			break;

			case "4":
				player(cid);
			break
		}
	}
}*/
//***********************************************************

//displays the player payment boxes (for modify)
//*******************************************************
function player2(cid)
{
	clearTable(cid);
	
	var tbody = document.getElementById(cid).getElementsByTagName("TBODY")[0];
	var row = document.createElement("TR");
	var row2 = document.createElement("TR");
	var row3 = document.createElement("TR");
	var t1 = document.createElement("TD");
	var t2 = document.createElement("TD");
	var t3 = document.createElement("TD");
	var t4 = document.createElement("TD");
	var t5 = document.createElement("TD");
	var t6 = document.createElement("TD");

	
	//the player account id row
	t1.innerHTML='<span class="txt">Player ID *</span>&nbsp;&nbsp;'
	//if(document.getElementById("HPlayerID").value == "")
	//	t2.innerHTML='<input cols="25" class="txt2" id="PlayerID" name="PlayerID"></input>'
	//else
	//	t2.innerHTML='<input cols="25" class="txt2" value='+document.getElementById("HPlayerID").value+' id="PlayerID" name="PlayerID"></input>'
	t2.innerHTML='<textarea cols="40" style="OVERFLOW: hidden" rows="1" class="txt2" name="PlayerID" maxlength="50" onkeyup="return ismaxlength(this)">'+document.getElementById("HPlayerID").value+'</textarea>'
	
	
	//apend the columns to the row
	row.appendChild(t1)
	row.appendChild(t2)

	//the player's first name
	t3.innerHTML='<span class="txt">First Name *</span>&nbsp;&nbsp;'
	//if(document.getElementById("HFName").value == "")
		//t4.innerHTML='<input cols="25" class="txt2"  id="FName" maxLength="20" name="FName"></input>'
	//else
	//	t4.innerHTML='<input cols="25" class="txt2" maxLength="20" value='+document.getElementById("HFName").value+' id="PlayerID" name="FName"></input>'
	t4.innerHTML='<textarea cols="40" style="OVERFLOW: hidden" rows="1" class="txt2" name="FName" maxlength="20" onkeyup="return ismaxlength(this)">'+document.getElementById("HFName").value+'</textarea>'
	
	
	//apend the columns to the row
	row2.appendChild(t3)
	row2.appendChild(t4)
	
	//the player's account id row
	t5.innerHTML='<span class="txt">Last Name *</span>&nbsp;&nbsp;'
	//if(document.getElementById("HLName").value == "")
	//	t6.innerHTML='<input cols="25" class="txt2"  id="LName" maxLength="20" name="LName"></input>'
	//else
	//	t6.innerHTML='<input cols="25" class="txt2" maxLength="20" value='+document.getElementById("HLName").value+' id="LName" name="LName"></input>'
	t6.innerHTML='<textarea cols="40" style="OVERFLOW: hidden" rows="1" class="txt2" name="LName" maxlength="20" onkeyup="return ismaxlength(this)">'+document.getElementById("HLName").value+'</textarea>'
	//apend the columns to the row
	row3.appendChild(t5)
	row3.appendChild(t6)

	//apend the rows to the table
	tbody.appendChild(row2)
	tbody.appendChild(row3)
	tbody.appendChild(row)
	

}
//display the neteller payment boxes (for modify)
//*******************************************************
function neteller2(cid)
{
	clearTable(cid);

	var tbody = document.getElementById(cid).getElementsByTagName("TBODY")[0];
	var row = document.createElement("TR");
	var row2 = document.createElement("TR");
	var t1 = document.createElement("TD");
	var t2 = document.createElement("TD");
	var t3 = document.createElement("TD");
	var t4 = document.createElement("TD");
	
	//the neteller email row
	t1.innerHTML='<span class="txt">Neteller Email *</span>&nbsp;&nbsp;'
	t2.innerHTML='<textarea cols="39" style="OVERFLOW: hidden" rows="1" class="txt2" name="Email" maxlength="50" onkeyup="return ismaxlength(this)">'+document.getElementById("HEmail").value+'</textarea>'
	//the neteller account number row
	t3.innerHTML='<span class="txt">Account Number *</span>&nbsp;&nbsp;'
	t4.innerHTML='<textarea cols="39" style="OVERFLOW: hidden" rows="1" class="txt2" name="Account" maxlength="50" onkeyup="return ismaxlength(this)">'+document.getElementById("HNetAccount").value+'</textarea>'
	
	
	//apend the columns to the row
	row.appendChild(t1)
	row.appendChild(t2)
	row2.appendChild(t3)
	row2.appendChild(t4)

	//apend the rows to the table
	tbody.appendChild(row)
	tbody.appendChild(row2)
	
}

//display the wire transfer boxes (for modify)
//********************************************************
function wireTransfer2(cid)
{
	clearTable(cid);

	var tbody = document.getElementById(cid).getElementsByTagName("TBODY")[0];
	var row = document.createElement("TR");
	var row2 = document.createElement("TR");
	var row3 = document.createElement("TR");
	var row4 = document.createElement("TR");
	var row5 = document.createElement("TR");
	var row6 = document.createElement("TR");
	var t1 = document.createElement("TD");
	var t2 = document.createElement("TD");
	var t3 = document.createElement("TD");
	var t4 = document.createElement("TD");
	var t5 = document.createElement("TD");
	var t6 = document.createElement("TD");
	var t7 = document.createElement("TD");
	var t8 = document.createElement("TD");
	var t9 = document.createElement("TD");
	var t10 = document.createElement("TD");
	var t11 = document.createElement("TD");
	var t12 = document.createElement("TD");

	//the bank account holder
	t9.innerHTML='<span class="txt">Account Holder *</span>&nbsp;&nbsp;'
	//t10.innerHTML='<input cols="25" maxLength="100" class="txt2" name="AccountHolder" value='+document.getElementById("HAccountHolder").value+'></input>'
	t10.innerHTML='<textarea cols="36" style="OVERFLOW: hidden" rows="1" class="txt2" name="AccountHolder" maxlength="100" onkeyup="return ismaxlength(this)">'+document.getElementById("HAccountHolder").value+'</textarea>'
	//apend the columns to the row
	row5.appendChild(t9)
	row5.appendChild(t10)
	
	//the bank account holder
	t11.innerHTML='<span class="txt"><b>(US/Canada Only)</b></span>'
	t12.innerHTML='<span class="txt">&nbsp;</span>'
	//apend the columns to the row
	row6.appendChild(t11)
	row6.appendChild(t12)

	//the bank name row
	t1.innerHTML='<span class="txt">Bank Name *</span>&nbsp;&nbsp;'
	//if(document.getElementById("HBankName").value == "")
	//	t2.innerHTML='<input cols="25" maxLength="100" class="txt2" name="BankName"></input>'
	//else
	//	t2.innerHTML='<input cols="25" class="txt2" name="BankName" value='+document.getElementById("HBankName").value+'></input>'
	t2.innerHTML='<textarea cols="36" style="OVERFLOW: hidden" rows="1" class="txt2" name="BankName" maxlength="100" onkeyup="return ismaxlength(this)">'+document.getElementById("HBankName").value+'</textarea>'

	//apend the columns to the row
	row.appendChild(t1)
	row.appendChild(t2)

	//the bank address
	t3.innerHTML='<span class="txt">Bank Address *</span>&nbsp;&nbsp;'
	t4.innerHTML='<textarea cols="34"class="txt2" rows="3" name="BankAddress" maxlength="300" onkeyup="return ismaxlength(this)">'+document.getElementById("HBankAddress").value+'</textarea>'
		
	//apend the columns to the row
	row2.appendChild(t3)
	row2.appendChild(t4)

	//the bank address
	t5.innerHTML='<span class="txt">Bank Account *</span>&nbsp;&nbsp;'
	//if(document.getElementById("HBankAccount").value == "")
	//	t6.innerHTML='<input cols="25"class="txt2" maxLength="50" name="BankAccount"></input>'
	//else
	//	t6.innerHTML='<input cols="25"class="txt2" maxLength="50" name="BankAccount" value='+document.getElementById("HBankAccount").value+'></input>'
	t6.innerHTML='<textarea cols="36" style="OVERFLOW: hidden" rows="1" class="txt2" name="BankAccount" maxlength="50" onkeyup="return ismaxlength(this)">'+document.getElementById("HBankAccount").value+'</textarea>'

	//apend the columns to the row
	row3.appendChild(t5)
	row3.appendChild(t6)

	//the aba swift
	t7.innerHTML='<span class="txt">Routing Number *</span>&nbsp;&nbsp;'
	//t8.innerHTML='<input cols="25"class="txt2" name="ABA" maxLength="50" value='+document.getElementById("HABA").value+'></input>'
	t8.innerHTML='<textarea cols="36" style="OVERFLOW: hidden" rows="1" class="txt2" name="ABA" maxlength="50" onkeyup="return ismaxlength(this)">'+document.getElementById("HABA").value+'</textarea>'
	//apend the columns to the row
	row4.appendChild(t7)
	row4.appendChild(t8)

	//apend the rows to the table
	tbody.appendChild(row5)
	tbody.appendChild(row)
	tbody.appendChild(row2)
	tbody.appendChild(row3)
	tbody.appendChild(row4)
	tbody.appendChild(row6)
	
}
//use to handle which payment method boxes to display (for modify)
//********************************************************
function dropDownMenu2(entered,cid)
{
	with(entered)
	{
		ref=options[selectedIndex].value;
		switch(ref)
		{
			case "1":
				check(cid);
			break;

			case "2":
				wireTransfer2(cid);
			break;

			case "3":
				neteller2(cid);
			break;

			case "4":
				player2(cid);
			break
		}
	}
}
//to control the max lenght of a textarea
//**********************************************************
function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}

//***********************************************
//functions for the copy paste link
//***********************************************
function highlightmetasearch(item) {
			item.select();
			item.focus();
		}

function copymetasearch(itemName) {
		var item = document.getElementById(itemName);
		highlightmetasearch(item);
		textRange = item.createTextRange();
		textRange.execCommand("RemoveFormat");
		textRange.execCommand("Copy");
}



		