/*add selector to menu*/
function addMenuSel(){	
	
	this.className = "sel";
}

function removeMenuSel(){
	this.className = "";
}

function addMenuAction(){
	
	menuElem = document.getElementById("menu");
	
	for(i=0;i<menuElem.childNodes.length;i++){		
		if(menuElem.childNodes[i].firstChild && menuElem.childNodes[i].tagName == "UL"){
			ulElem = menuElem.childNodes[i];
			for(j=0;j<ulElem.childNodes.length;j++){
				
				if(ulElem.childNodes[j].tagName == "LI" && j!=ulElem.childNodes.length-1){
					if(ulElem.childNodes[j].className != "selpag"){
						ulElem.childNodes[j].onmouseover = addMenuSel;
						ulElem.childNodes[j].onmouseout = removeMenuSel;					
					}
				}
			}
		}
	}	
}

function show_reg(){
		$('#basicModalContent').modal();	
}


///////////////////////////////////////Submeniu//////////////////////////////////////
function getSubmenuHide(){
	ids = $("div#contentp").find("div.submenu").find("a");
	for(i=0;i<ids.length;i++){
		temp =ids[i].toString().split('#');	
		if(temp.length==2)	
		document.getElementById(temp[1]).style.display = "none";
	}		
}

function getSubmenu(){	
	ids = $("div#contentp").find("div.submenu").find("a");
	for(i=0;i<ids.length;i++){
		ids[i].onclick = submenuClick;
		temp =ids[i].toString().split('#');
		
		if(i && temp.length==2)
			document.getElementById(temp[1]).style.display = "none";
	}
	go2Submenu();
}
function submenuClick(){
	getSubmenuHide();
	ids = $(this).attr("href");
	temp =ids.toString().split('#');
	if(temp.length == 2)
	document.getElementById(temp[1]).style.display = "block";
}

function showDivPage(obj){
	getSubmenuHide();
	ids = $(obj).attr("name");	
	temp =ids.toString().split('?');
	if(temp.length == 2)
	document.getElementById(temp[1]).style.display = "block";
}

function go2Submenu(){
	strHref = window.location.href;
	if(strHref.indexOf("#") > -1){
		var strQueryString = strHref.substr(strHref.indexOf("#")+1);
		getSubmenuHide();
		document.getElementById(strQueryString).style.display = "block";
	}
}
///////////////////////////////////////Submeniu//////////////////////////////////////

//////////////////////////////////////DATE/////////////////////////////////////////////
function getCalendarDate()
{
   var months = new Array(13);
   months[0]  = "January";
   months[1]  = "February";
   months[2]  = "March";
   months[3]  = "April";
   months[4]  = "May";
   months[5]  = "June";
   months[6]  = "July";
   months[7]  = "August";
   months[8]  = "September";
   months[9]  = "October";
   months[10] = "November";
   months[11] = "December";
   var now         = new Date();
   var monthnumber = now.getMonth();
   var monthname   = months[monthnumber];
   var monthday    = now.getDate();
   var year        = now.getYear();
   if(year < 2000) { year = year + 1900; }
   var dateString = monthname +
                    ' ' +
                    monthday +
                    ', ' +
                    year;
   return dateString;
} // function getCalendarDate()

function getClockTime()
{
   var now    = new Date();
   var hour   = now.getHours()-2;
   var minute = now.getMinutes();
   var second = now.getSeconds();
   var ap = "AM";
   if (hour   > 11) { ap = "PM";             }
   if (hour   > 12) { hour = hour - 12;      }
   if (hour   == 0) { hour = 12;             }
   if (hour   < 10) { hour   = "0" + hour;   }
   if (minute < 10) { minute = "0" + minute; }
   if (second < 10) { second = "0" + second; }
   var timeString = hour +
                    ':' +
                    minute +
                    ':' +
                    second +
                    " " +
                    ap;
   return timeString;
} // function getClockTime()

var refreshCurrentTime = 0;
function showCurrentDate1(){
	var calendarDate = getCalendarDate();
	var clockTime = getClockTime();
	document.getElementById("currentTime").innerHTML = calendarDate+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+clockTime;
	//var to = setInterval(showCurrentDate, 100);
	showCurrentDate();
	clearTimeout (refreshCurrentTime);
}

function showCurrentDate(){
	var refreshCurrentTime = setTimeout ("showCurrentDate1()", 100);
}
//////////////////////////////////////DATE/////////////////////////////////////////////

//change moneybookers account
function changeAccount(obj){
	document.getElementById("aff_cash_account").value = obj.value;
}

function affSelectType(dateVal){
	selType = document.getElementById("select_type"+dateVal).value;
	window.location = "http://www.betclubpoker.com/"+selType+"/"+dateVal;	
}

function adminAddLevelAff(){	
	document.getElementById('tableProcent').innerHTML += '<tr class="oddrow"><td>&euro;<input type="text" value=""  name="rake[]"></td>	<td><input type="text" maxlength="5" size="5" value="" name="procent[]">%</td></tr>';
}

function adminAddPromotion(){	
	document.getElementById('tablePromotion').innerHTML += '<tr class="oddrow"><td><input type="text" value=""  name="rake[]"></td>	<td><input type="text"  value="" name="price[]" style="width:400px;"></td></tr>';
}