
function DoSearch(evt)
{var charCode=0;if(evt!=null)
{if(typeof evt.which!="undefined")
{charCode=evt.which;}
else if(typeof event.keyCode!="undefined")
{charCode=event.keyCode;}}
else
{charCode=13;}
if(charCode!=13)
{return false;}
var str=document.getElementById('searchString').value;str=str.replace(/^\s\s*/,'').replace(/\s\s*$/,'');if(str==null||str=="")
{return false;}
document.getElementById('searchString').blur();for(var i=0;i<str.length;i++)
{var char=str.charCodeAt(i);if((char<48&&char!=32)||(char>57&&char<65)||(char>90&&char<97)||char>122)
{showMessageBox(g_strImageServerUrl+"/compatibility/compatibilityIconNotOkBg.png","SEARCH","Illegal character '"+str.substring(i,i+1)+"' has been used in search keyword(s)");return false;}}
var searchVal=str;searchVal=replaceAll(searchVal,"\"","\\\"");searchVal=getUrlEscapeString(searchVal);document.getElementById('searchString').focus();document.getElementById('searchString').blur();viewGameSearchResultList(searchVal);return false;}
function doSelectGame()
{var comboBox=document.getElementById('gamesList');var selectedGameId=comboBox.options[comboBox.selectedIndex].value;window.location.href=g_ContextPath+"/do/index?game="+selectedGameId;}
function newsLetterSignIn(evt)
{var charCode=0;if(evt!=null)
{if(typeof evt.which!="undefined")
{charCode=evt.which;}
else if(typeof event.keyCode!="undefined")
{charCode=event.keyCode;}}
else
{charCode=13;}
if(charCode!=13)
{return false;}
var elementEmailAddress=document.getElementById('newsletterAddress');var strEmailAddress=elementEmailAddress.value;var strError="";var strIconUrl=g_strImageServerUrl+"/compatibility/compatibilityIconNotOkBg.png";if(!CheckLength(strEmailAddress))
{strError="E-mail address required";}
else if(!ValidateEmailAddress(strEmailAddress))
{strError="Invalid e-mail address format";}
else
{try
{var strURL=g_ContextPath+"/do/newsLetterSubscribe?action=add&emailAddress="+strEmailAddress;var xmlDoc=xmlDocLoadURLSync(strURL);var nodeResult;nodeResult=xmlDoc.getElementsByTagName("result");if((null==nodeResult)||(null==nodeResult.item(0).text)||(nodeResult.item(0).text!="success"))
{strError="Internal problem, please retry later";}
else
{strError="Thank you! Your e-mail '"+strEmailAddress+"' was successfully added to newsletter mailing list";strIconUrl=g_strImageServerUrl+"/compatibility/compatibilityIconOkBg.png";}}
catch(e)
{strError="Internal problem, please retry later";}}
elementEmailAddress.value="";showMessageBox(strIconUrl,"NEWSLETTER",strError);}
function CheckLength(str)
{try
{if(str.length>0)
{return true;}
return false;}
catch(e)
{return true;}}
function ValidateEmailAddress(str)
{if(str.indexOf("@")<=0||str.indexOf("@")>=parseInt(str.length)-1)
{return false;}
if(str.indexOf(".")<=0||str.indexOf(".")>=parseInt(str.length)-1)
{return false;}
return true;}