function selTab(iTabID) {
	for (var i=1;i<=5;i++)
	{
		if (i.toString() == iTabID) 
		{
			document.getElementById('litab' + i).className='selected';
			document.getElementById('tcontent' + i).style.display = 'block';
		}
		else
		{
			document.getElementById('litab' + i).className='';
			document.getElementById('tcontent' + i).style.display = 'none';
		}
	}
}

function selTabTh(iTabID) {
	for (var i=1;i<=4;i++)
	{
		if (i.toString() == iTabID) 
		{
			document.getElementById('Th_litab' + i).className='selected';
			document.getElementById('Th_tcontent' + i).style.display = 'block';
		}
		else
		{
			document.getElementById('Th_litab' + i).className='';
			document.getElementById('Th_tcontent' + i).style.display = 'none';
		}
	}
}








function wndOpenCharts(sEventID, sType, sInsID) {
  var iWidth = 860;
  var iHeight = 750;
  var iLeft = (((window.screen.availWidth - iWidth) / 2));
  var iTop = (((window.screen.availHeight - iHeight) / 2))
  if (iTop < 30) { iTop = 1 }
  if (iLeft < 30) { iLeft = 1 }
  window.open('/charts/?eveid=' + sEventID + '&gamty=' + sType + '&insid=' + sInsID, "tm", 'top=' + iTop + ', left=' + iLeft + ', width=' + iWidth + ', height=' + iHeight + ', location=no, address=no, scrollbars=1, resizable=1, status=no')
}

function wndOpenEventInfo(sEventID) {
  var iWidth = 860;
  var iHeight = 750;
  var iLeft = (((window.screen.availWidth - iWidth) / 2));
  var iTop = (((window.screen.availHeight - iHeight) / 2))
  if (iTop < 30) { iTop = 1 }
  if (iLeft < 30) { iLeft = 1 }
  window.open('/event-info/?eveid=' + sEventID, "ei", 'top=' + iTop + ', left=' + iLeft + ', width=' + iWidth + ', height=' + iHeight + ', location=no, address=no, scrollbars=1, resizable=1, status=no')
}

//GENERIC
function mngDocChrSt(sCharset, iFixCharset){
	var undefined;
	if (document.charset!=undefined && document.charset!=sCharset) {
		if (iFixCharset!='1'){
			document.charset=sCharset;
			var sDocHref = document.location.href
			if (sDocHref.indexOf('?')>0) {sDocHref += '&iFixCharset=1';} else {sDocHref += '?iFixCharset=1';}
			document.location.href = sDocHref;
		} else {
			alert('Yparxei kapoio problhma stis ru8miseis toy Internet Epxlorer kai isws na mhn mporeite na diavasete Ellhnikous Xarakthres.\n\nGia na dior8wsete to problhma kante dexi click se kapoio keno meros ths selidas kai epilexte "Encoding" kai sthn sunexeia "Greek (Windows)".\n\nAn den mporesete na dior8wsete to problhma, mporeite na mas steilete email sto support@oxybet.com gia na sas boh8hsoume.')
		}
	}
}
//
function Trim(strInputString){
	strInputString = strInputString + ' '
	objRegExp = /(^ +)|( +$)/g
	return strInputString.replace(objRegExp, "");
}
function blnValidEmail(strInputString){
	var objRegExp = /(^[^@]+@[^@]+\..+$)/gi
	if (objRegExp.test(strInputString)) {return true;} else {
		alert('Η διεύθυνση email που πληκτρολόγησες δεν είναι σωστή!');
		return false;
		}
}
function blnValidLatinString(strInputString){
	var objRegExp = /(^[a-z0-9]+$)/gi
	if (objRegExp.test(strInputString)) {return true;} else {return false;}
}

//WINDOWS
function wjsLS(sURL){
	try {
	var iTop = (screen.height-700)/2
	var iLeft = (screen.width-520)/2	
	window.open('' + sURL, 'ls', 'top=' + 50 + ', left=' + iLeft + ', width=520, height=700, scrollbars=yes, location=no')
	} catch (error) { alert('Δεν έχετε σωστές ρυθμίσεις για την εκτέλεση κώδικα για αυτό και δεν είναι δυνατή η δημιουργία νέου παραθύρου.');}
}

//SVC
function toFriendsPrepare(){
	var sTemp = document.location.href;
	try{
	sTemp = sTemp.replace(/\?/g, '@q@');
	sTemp = sTemp.replace(/\&/g, '@a@');
	sTemp = 'url=' + sTemp + '&title=' + document.title;
	} catch (error) {sTemp = '';}
	document.location.href='/tofriends.asp?' + sTemp
}
function toFriendsSubmit(){
	document.frmFriends.myEmail.value = Trim(document.frmFriends.myEmail.value)
	document.frmFriends.myMessage.value = Trim(document.frmFriends.myMessage.value)
	if (!blnValidEmail(document.frmFriends.myEmail.value)) {alert('Δεν έχεις πληκτρολογήσει σωστά το email σου.'); document.frmFriends.myEmail.focus(); return}
	document.frmFriends.fEmail_01.value = Trim(document.frmFriends.fEmail_01.value)
	document.frmFriends.fEmail_02.value = Trim(document.frmFriends.fEmail_02.value)
	document.frmFriends.fEmail_03.value = Trim(document.frmFriends.fEmail_03.value)
	document.frmFriends.fEmail_04.value = Trim(document.frmFriends.fEmail_04.value)
	if (!blnValidEmail(document.frmFriends.fEmail_01.value)) {alert('Δεν έχεις πληκτρολογήσει σωστά το 1ο email.'); document.frmFriends.fEmail_01.focus(); return}
	if (document.frmFriends.fEmail_02.value!='') {if (!blnValidEmail(document.frmFriends.fEmail_02.value)) {alert('Δεν έχεις πληκτρολογήσει σωστά το 2ο email.'); document.frmFriends.fEmail_02.focus(); return}}
	if (document.frmFriends.fEmail_03.value!='') {if (!blnValidEmail(document.frmFriends.fEmail_03.value)) {alert('Δεν έχεις πληκτρολογήσει σωστά το 3ο email.'); document.frmFriends.fEmail_03.focus(); return}}
	if (document.frmFriends.fEmail_04.value!='') {if (!blnValidEmail(document.frmFriends.fEmail_04.value)) {alert('Δεν έχεις πληκτρολογήσει σωστά το 4ο email.'); document.frmFriends.fEmail_04.focus(); return}}
	if (document.frmFriends.fEmail_05.value!='') {if (!blnValidEmail(document.frmFriends.fEmail_05.value)) {alert('Δεν έχεις πληκτρολογήσει σωστά το 5ο email.'); document.frmFriends.fEmail_05.focus(); return}}
	document.frmFriends.btnSubmit.disabled=true;
	document.frmFriends.submit()
}
function toFriends(){
	var sTemp = document.location.href;
	try{
	sTemp = sTemp.replace(/\?/g, '@q@');
	sTemp = sTemp.replace(/\&/g, '@a@');
	sTemp = 'sCntnUrl=' + sTemp + '&sCntnTxt=' + document.title;
	} catch (error) {sTemp = '';}
	document.location.href='/svc/tofriends.asp?' + sTemp
}
function signUpQ(){
	document.frmSignUpQuick.suqEmail.value = Trim(document.frmSignUpQuick.suqEmail.value)
	if (!blnValidEmail(document.frmSignUpQuick.suqEmail.value)) {alert('Δεν έχεις πληκτρολογήσει σωστά το email σου.'); document.frmSignUpQuick.suqEmail.focus(); return}
	var sTemp = document.location.href;
	try{
	sTemp = sTemp.replace(/\?/g, '@q@');
	sTemp = sTemp.replace(/\&/g, '@a@');
	sTemp = 'sCntnUrl=' + sTemp + '&sCntnTxt=' + document.title;
	} catch (error) {sTemp = '';}
	document.frmSignUpQuick.action = 'signupqExecute.asp?' + sTemp;
	document.frmSignUpQuick.btnSubmit.disabled=true;
	document.frmSignUpQuick.submit()
}
function signPwd(){
	document.frmFgtPwd.sFgtEmail.value = Trim(document.frmFgtPwd.sFgtEmail.value)
	if (!blnValidEmail(document.frmFgtPwd.sFgtEmail.value)) {alert('Δεν έχεις πληκτρολογήσει σωστά το email σου.'); document.frmFgtPwd.sFgtEmail.focus(); return}
	document.frmFgtPwd.action = 'memberExecute.asp?case=forgotPwd'
	document.frmFgtPwd.btnSubmit.disabled=true;
	document.frmFgtPwd.submit()
}



function signIn(){
	document.frmSignIn.memEmail.value = Trim(document.frmSignIn.memEmail.value)
	if (!blnValidEmail(document.frmSignIn.memEmail.value)) {alert('Δεν έχεις πληκτρολογήσει σωστά το email σου.'); document.frmSignIn.memEmail.focus(); return}
	var sTemp = document.location.href;
	try{
	sTemp = sTemp.replace(/\?/g, '@q@');
	sTemp = sTemp.replace(/\&/g, '@a@');
	sTemp = 'sCntnUrl=' + sTemp + '&sCntnTxt=' + document.title;
	} catch (error) {sTemp = '';}
	document.frmSignIn.action = 'signInExecute.asp?' + sTemp;
	document.frmSignIn.btnSubmit.disabled=true;
	document.frmSignIn.submit()
}
function changePwd(){
	if (document.frmChangePwd.oldPassword.value.length==0) {alert('Δεν έχεις πληκτρολογήσει τον παλιό κωδικό.'); document.frmChangePwd.oldPassword.focus(); return}
	if (document.frmChangePwd.newPassword.value.length==0) {alert('Δεν έχεις πληκτρολογήσει τον νέο κωδικό.'); document.frmChangePwd.newPassword.focus(); return}

	if (document.frmChangePwd.newPassword.value != document.frmChangePwd.necPassword.value) {alert('Δεν έχεις πληκτρολογήσει τον ίδιο νέο κωδικό.'); document.frmChangePwd.necPassword.focus(); return}
	document.frmChangePwd.action = 'memberExecute.asp?case=changePwd'
	document.frmChangePwd.btnSubmit.disabled=true;
	document.frmChangePwd.submit()
}
function nslttrSetOff(){
	bConf = window.confirm('Επιλέξατε να απενεργοποιήσετε την υπηρεσία newsletter του oxybet.com\n\nΕίστε σίγουρος πως θέλετε να προχωρήσετε;');
	if (bConf) {document.location.href='memberExecute.asp?case=nslttrSetOff'}
}
function nslttrSetOn(){
	bConf = window.confirm('Επιλέξατε να ενεργοποιήσετε την υπηρεσία newsletter του oxybet.com\n\nΕίστε σίγουρος πως θέλετε να προχωρήσετε;');
	if (bConf) {document.location.href='memberExecute.asp?case=nslttrSetOn'}
}

function toCompetition(){

	document.getElementById("ansEmail").value = Trim(document.getElementById("ansEmail").value)
	document.getElementById("ansAnswerChr1").value = Trim(document.getElementById("ansAnswerChr1").value)
	if (!document.getElementById("ansAnswerChr1").value.length > 0) {alert('Δεν έχεις πληκτρολογήσει σωστά το username για την εγγραφή σου.'); document.getElementById("ansAnswerChr1").focus(); return}
	if (!blnValidEmail(document.getElementById("ansEmail").value)) {document.getElementById("ansEmail").focus(); return}
	document.getElementById("frmCompetition").action = 'mngCompetition.asp'
	document.getElementById("btnSubmit").disabled=true;
	document.getElementById("frmCompetition").submit()
}

function show_table() {
	document.getElementById('table').style.display = 'block';
	document.getElementById('table_home').style.display = 'none';
	document.getElementById('table_away').style.display = 'none';
	document.getElementById('label_table').className = 'selected';
	document.getElementById('label_table_home').className = '';
	document.getElementById('label_table_away').className = '';
}
function show_table_home() {
	document.getElementById('table').style.display = 'none';
	document.getElementById('table_home').style.display = 'block';
	document.getElementById('table_away').style.display = 'none';
	document.getElementById('label_table').className = '';
	document.getElementById('label_table_home').className = 'selected';
	document.getElementById('label_table_away').className = '';
}
function show_table_away() {
	document.getElementById('table').style.display = 'none';
	document.getElementById('table_home').style.display = 'none';
	document.getElementById('table_away').style.display = 'block';
	document.getElementById('label_table').className = '';
	document.getElementById('label_table_home').className = '';
	document.getElementById('label_table_away').className = 'selected';
}

function show_competitor(CompetitorID) {
	document.getElementById('competitor_' + CompetitorID).style.display = 'block';
	document.getElementById('competitor_home_' + CompetitorID).style.display = 'none';
	document.getElementById('competitor_away_' + CompetitorID).style.display = 'none';
	document.getElementById('label_competitor_' + CompetitorID).className = 'selected';
	document.getElementById('label_competitor_home_' + CompetitorID).className = '';
	document.getElementById('label_competitor_away_' + CompetitorID).className = '';
}

function show_competitor_home(CompetitorID) {
	document.getElementById('competitor_' + CompetitorID).style.display = 'none';
	document.getElementById('competitor_home_' + CompetitorID).style.display = 'block';
	document.getElementById('competitor_away_' + CompetitorID).style.display = 'none';
	document.getElementById('label_competitor_' + CompetitorID).className = '';
	document.getElementById('label_competitor_home_' + CompetitorID).className = 'selected';
	document.getElementById('label_competitor_away_' + CompetitorID).className = '';
}

function show_competitor_away(CompetitorID) {
	document.getElementById('competitor_' + CompetitorID).style.display = 'none';
	document.getElementById('competitor_home_' + CompetitorID).style.display = 'none';
	document.getElementById('competitor_away_' + CompetitorID).style.display = 'block';
	document.getElementById('label_competitor_' + CompetitorID).className = '';
	document.getElementById('label_competitor_home_' + CompetitorID).className = '';
	document.getElementById('label_competitor_away_' + CompetitorID).className = 'selected';
}

function wResultHistoryChartOpen(iInstallationID, iEventID, sGameType, sResultType){
	try {
	var iTop = (screen.height-800)/2
	var iLeft = (screen.width-740)/2
	var sURL = '/services/charts/ResultHistory.aspx?insid=' + iInstallationID + '&eveid=' + iEventID + '&gamtype=' + sGameType + '&restype=' + sResultType
	window.open('' + sURL, 'ResultHistoryChart' , 'top=' + 50 + ', left=' + iLeft + ', width=800, height=740, scrollbars=yes, location=no')
	} catch (error) { alert('Δεν έχετε σωστές ρυθμίσεις για την εκτέλεση κώδικα για αυτό και δεν είναι δυνατή η δημιουργία νέου παραθύρου.');}
}

function goIns(iInsID) {
	window.open('http://ads.betfair.com/redirect.aspx?pid=655&amp;bid=1862','ins'+iInsID);
}

function changeClassName(iId, sClassName) {
	if (document.getElementById(iId)) {
		document.getElementById(iId).className = sClassName;
	}
}

