function validateProfile()
{
	var firstname = window.document.editprofile.firstname.value;
	var lastname = window.document.editprofile.lastname.value;
	var bmon = window.document.editprofile.bmon.value;
	var byear = window.document.editprofile.byear.value;
	var bday = window.document.editprofile.bday.value;
	var address = window.document.editprofile.address.value;
	var city = window.document.editprofile.city.value;
	var country = window.document.editprofile.country.value;
	var zip = window.document.editprofile.zip.value;
	var phone = window.document.editprofile.phone.value;
	
	var myRegxp = /[0-9]/;
	var myRegxpPhone = /[A-Za-z]/;
	if(firstname == "")
	{
		alert(" First Name can't be Blank");
		window.document.editprofile.firstname.focus();
		return false;
	}
	if(lastname == "")
	{
		alert("Last Name can't be Blank");
		window.document.editprofile.lastname.focus();
		return false;
	}
	if(bmon == "" || byear =="" || bday == "")
	{
		alert("Please Enter Date of Birth");
		window.document.editprofile.bmon.focus();
		return false;
	}
	if(address == "")
	{
		alert("Address can't be Blank");
		window.document.editprofile.address.focus();
		return false;
	}
	if(city == "")
	{
		alert("City can't be Blank");
		window.document.editprofile.city.focus();
		return false;
	}
	if(country == "")
	{
		alert("Country can't be Blank");
		window.document.editprofile.country.focus();
		return false;
	}
	if(zip == "")
	{
		alert("Zip/Postal Code can't be Blank");
		window.document.editprofile.firstname.focus();
		return false;
	}
	if(phone == "")
	{
		alert("Phone  can't be Blank");
		window.document.editprofile.phone.focus();
		return false;
	}
	

	
	if(myRegxp.test(document.editprofile.firstname.value))
	{
		alert("First name cannot contain a numerical 0-9 value.");
		return false;
	}
	if(myRegxp.test(document.editprofile.lastname.value))
	{
		alert("Last name cannot contain a numerical 0-9 value.");
		return false;
	}
	if(myRegxpPhone.test(document.editprofile.phone.value))
	{
		alert("Telephone number must be a numerical 0-9 value.");
		return false;
	}
}
////////////////////// Validation.js  **********************************************************************
//*************** Validate Password ***************//
function validatePwd() 
{
	var invalid = " "; // Invalid character is a space
	var minLength = 6; // Minimum length
	if (document.myForm.currentpasswd)//RAJESH PAGADALA
	{	
		var ctp = document.myForm.currentpasswd.value;
		if(ctp == '') 
		{
			alert('Enter your Current Password');
			document.myForm.currentpasswd.focus();
			return false;
		}
	}
	
	var pw1 = document.myForm.newpasswd1.value;
	var pw2 = document.myForm.newpasswd2.value;

	
	// Check for a Value in Both Fields.
	if (pw1 == '' || pw2 == '') 
	{
		alert('Please enter a new password in both the fields.');
		document.myForm.newpasswd1.focus();
		return false;
	}
	// Check for Minimum Length
	if (pw1.length < minLength) 
	{
		alert('Your password must be at least ' + minLength + ' characters long. Please Try again.');
		document.myForm.newpasswd1.focus();
		return false;
	}
	// Check for Spaces
	if (pw1.indexOf(invalid) > -1) 
	{
		alert("Spaces are not allowed as Password. Please re-enter again.");
		document.myForm.newpasswd1.focus();
		return false;
	}
	else 
	{
		if (pw1 != pw2) 
		{
			alert ("You did not enter the same new password in both the fields. Please Try again.");
			document.myForm.newpasswd1.focus();
			return false;
		}
	}
}


//var swear_words_arr=new Array("fuck","bloody","war","terror");
var swear_words_arr=new Array("ass","asses","asshole","assholes","bastard","beastial","beastiality","beastility","bestial","bestiality","bitch","bitcher","bitchers","bitches","bitchin","bitching","blowjob","blowjobs","clit","cock","cocks","cocksuck","cocksucked","cocksucker","cocksucking","cocksucks","cum","cummer","cumming","cums","cumshot","cunilingus","cunillingus","cunnilingus","cunt","cuntlick ","cuntlicker","cuntlicking","cunts","cyberfuc","cyberfuck","cyberfucked","cyberfucker","cyberfuckers","cyberfucking","damn ","dildo","dildos","dink","dinks","ejaculate","ejaculated","ejaculates","ejaculating","ejaculatings","ejaculation","fag","fagging","faggot","faggs","fagot","fagots","fags","fart","farted","farting","fartings","farts","farty","felatio","fellatio","fingerfuck","fingerfucked","fingerfucker","fingerfuckers","fingerfucking","fingerfucks","fistfuck","fistfucked","fistfucker","fistfuckers","fistfucking","fistfuckings","fistfucks","fuck","fucked","fucker","fuckers","fuckin","fucking","fuckings","fuckme ","fucks","fuk","fuks","gangbang","gangbanged","gangbangs","gaysex","goddamn","hardcoresex","hell","horniest","horny","hotsex","jack-off","jerk-off","jism","jiz ","jizm ","kock","kondum","kondums","kum","kummer","kumming","kums","kunilingus","lust","lusting","mothafuck","mothafucka","mothafuckas","mothafuckaz","mothafucked ","mothafucker","mothafuckers","mothafuckin","mothafucking","mothafuckings","mothafucks","motherfuck","motherfucked","motherfucker","motherfuckers","motherfuckin","motherfucking","motherfuckings","motherfucks","nigger","niggers","orgasim","orgasims","orgasm","orgasms","phonesex","phuk","phuked","phuking","phukked","phukking","phuks","phuq","piss","pissed","pisser","pissers","pisses","pissin","pissing","pissoff","porn","porno","pornography","pornos","prick","pricks","pussies","pussy","pussys","shit","shited","shitfull","shiting","shitings","shits","shitted","shitter","shitters ","shitting","shittings","shitty","slut","sluts","smut","spunk","twat","idiot","rogue", "rascal","scoundrel");
var swear_alert_arr=new Array;
var swear_alert_count=0;

function reset_alert_count()
{
     swear_alert_count=0;
}

function validate_user_text(comp_obj)
{
     reset_alert_count();
     var compare_text = comp_obj.value;
     for(var i=0; i<swear_words_arr.length; i++)
     {
        for(var j=0; j<(compare_text.length); j++)
        {
            if(swear_words_arr[i]==compare_text.substring(j,(j+swear_words_arr[i].length)).toLowerCase())
            {
                swear_alert_arr[swear_alert_count]=compare_text.substring(j,(j+swear_words_arr[i].length));
                swear_alert_count++;
            }
        }
     }
/*     var alert_text="";
     for(var k=1; k<=swear_alert_count; k++)
     {
        alert_text+="\n" + "(" + k + ")  " + swear_alert_arr[k-1];
     }
*/	 
     if(swear_alert_count>0)
     {
		alert("The alias you have selected is not permitted. Please change and try again.");
        comp_obj.select();
		return 0;
     }
     else
     {
        return 1;
     }
}

function select_area()
{
     document.form1.user_text.select();
}

//window.onload=reset_alert_count;



//*************** Validate Registration ***************//
function register_val(register) 
{
	var als = window.document.register.alias.value;
	var pw1 = window.document.register.passwd.value;
	var pw2 = window.document.register.confirm_passwd.value;
	var invalid = " "; // Invalid character is a space
	var minLength = 6; // Minimum length
	
	if(als == "")
	{
		alert("Please enter an Alias.");
		window.document.register.alias.focus();
		return false;
	}
	
	if (pw1 == '' || pw2 == '') 
	{
		alert('Please enter a  password in both the fields.');
		window.document.register.passwd.focus();
		return false;
	}
	// Check for Minimum Length
	if (pw1.length < minLength) 
	{
		alert('Your password must be at least ' + minLength + ' characters long. Please Try again.');
		window.document.register.passwd.focus();
		return false;
	}
	// Check for Spaces
	if (pw1.indexOf(invalid) > -1) 
	{
		alert("Spaces are not allowed as Password. Please re-enter again.");
		window.document.register.passwd.focus();
		return false;
	}
	else 
	{
		if (pw1 != pw2) 
		{
			alert ("You did not entered the same password in both the fields. Please Try again.");
			window.document.register.passwd.focus();
			return false;
		}
	}
	
	
	
	var e1 = document.register.email.value;
	if (e1 == '') 
	{
		alert('Please enter your email.');
		window.document.register.email.focus();
		return false;
	}
			
	var testresults;
	var str=window.document.register.email.value;
	var filter=/^\w+([\.\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
		
	if (filter.test(str))
	{
		testresults=true;
	}else {
		alert("Please input a valid email address!")
		window.document.register.email.select();
		testresults=false;
	}
	return (testresults);
	
}


//*************** Validate Email ***************//
function checkEmail(myForm)
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.emailid.value))
	{
		return (true)
	}
	alert("Invalid E-mail Address! Please re-enter.")
	return (false)
}


//*************** Process Logout ***************//
function logout()
{	
	var name=confirm("Are you sure you to want Logout ?")
	if (name==true)
	{
		window.location.href="/logout.php";
	}
	else 
	{
		
	}
}


//*************** Validate Login Form ***************//
function validate(formCheck) 
{
	var invalid = " ";
	if(formCheck.login.value=="")
	{
		alert("Please enter your Name");
		formCheck.login.focus();
		return false;
	}
	if(formCheck.passwd.value=="")
	{
		alert("Please enter Your Password");
		formCheck.passwd.focus();
		return false;
	}
	
	if (formCheck.login.value.indexOf(invalid) > -1 || formCheck.passwd.value.indexOf(invalid) > -1) 
	{
		alert("Spaces are not allowed as Password. Please re-enter again.");
		Form1.passwd.select();
		return false;
	}
}


//*************** Validate Deposits ***************//
function validate_deposit(mainform) 
{
	var amount = window.document.mainform.amount.value;
	if (amount=='') 
	{
		alert('Please enter an amount to Deposit');
		window.document.mainform.amount.select();
		return false;
	}
	else if(amount <=0)
	{
		alert('The amount you have entered is invalid, Please re-enter again.');
		window.document.mainform.amount.select();
		return false;
	}
	else if(amount >1000)
	{
		alert('You cannot deposit more than 1000 per transaction.');
		window.document.mainform.amount.select();
		return false;
	}
}


//*********************** Validate Card Number ***********************//
function ValidateCardNumber(form)
{
	CN = form.card_number.value;
	SpecialChars = /\$|,|@|#|~|`|\%|\*|\^|\&|\(|\)|\+|\=|\[|\-|\_|\]|\[|\}|\{|\;|\:|\'|\"|\<|\>|\?|\||\s|\\|\!|\/|\$|\.|[a-z]|[A-Z]/g;
	form.card_number.value = CN.replace(SpecialChars,'');
}


//*********************** Validate LPS ***********************//
function minimum_deposit() {
	var amount = document.cashier.amount.value;
	if (amount < 10) {
		alert("Minimum deposit amount is \u00A310");
		window.document.cashier.amount.focus();
		return false;
	}
	if (isNaN(amount)) {
		alert("Minimum deposit amount is \u00A310");
		window.document.cashier.amount.focus();
		return false;
	}	
}


//*************** Return to Status Page from POS ***************//
function openBlankWindow(trackid, paymenttype)
{
	window.open('','POS', 'width=700, height=600, left=200, top=40, scrollbars=yes, toolbar=no, status=yes, resizable=no');
	parent.location.href=paymenttype+'/status.php?trackid='+trackid;
	return true;
}


//*************** Display Bingo Timer ***************//
function init()
{
	setTimeout('refreshTimer()', 1000);
}

function refreshTimer()
{
	var streams = document.getElementById("streams");
	var timers = document.getElementById("streams").value ;

	var i=1 ;
	for ( i=1 ; i < timers ;i++)
	{
		time = document.getElementById("time"+i);
		seconds = time.value ;
		seconds = seconds - 1 ; 
		time.value=seconds ;
		message = document.getElementById("message"+i);
		if ( seconds < 1 ) 
			message.innerHTML="Started" ;
		else
		{
			min = (seconds - seconds % 60) / 60 ; 
			sec = seconds%60 ;
			if ( sec < 10 ) 
				str = min+":0"+sec ;
			else
				str = min+":"+sec ; 
			message.innerHTML = str ;
		}

	}
	setTimeout('refreshTimer()', 1000); 
}


//*************** Open POPUP Window ***************//
function MM_openBrWindow(theURL,winName,features) 
{ 
	window.open(theURL,winName,features);
}


//*************** Getting Started ***************//
function newImage(arg) {
	
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() 
{
	
	if (document.images && (preloadFlag == true)) 
	{
		for (var i=0; i<changeImages.arguments.length; i+=2) 
		{
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}


//*************** Getting Started   TOOL TIP***************//
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function prepareInputsForHints() {
	var inputs = document.getElementsByTagName("td");
	for (var i=0; i<inputs.length; i++){
		// test to see if the hint span exists first
		if (inputs[i].parentNode.getElementsByTagName("small")[0]) {
			// the span exists!  on focus, show the hint
			inputs[i].onmouseover= function () {
				this.parentNode.getElementsByTagName("small")[0].style.display = "inline";
			}
			
			
			// when the cursor moves away from the field, hide the hint
			inputs[i].onmouseout = function () {
				this.parentNode.getElementsByTagName("small")[0].style.display = "none";
			}
		}
	}
	/*  // repeat the same tests as above for selects
	var selects = document.getElementsByTagName("select");
	for (var k=0; k<selects.length; k++){
		if (selects[k].parentNode.getElementsByTagName("span")[0]) {
			selects[k].onclick = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
			}
			selects[k].mouseout = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "none";
			}
		}
	}
	*/
}
addLoadEvent(prepareInputsForHints);
////////////////////// Validation.js  **********************************************************************
////////////////////// Hint.js  *********************************************************************************

////////////////////// ClickHideshowmenu.js  **********************************************************************
function ClickShowHideMenu(id, clicked_menu) {
	show_menu = id+"-"+(clicked_menu-1);
	this.box1Hover = true;
    this.box2Hover = true;
    this.highlightActive = false;
    this.menu_id = 1;
    this.init = function () {
        if (!document.getElementById(this.id)) {
            //alert("Element '" + this.id + "' does not exist in this document. ClickShowHideMenu cannot be initialized");
			alert("Unable to load Java Script. Please check your browser settings and refresh the page.");
            return;
        }
        this.parse(document.getElementById(this.id).childNodes, this.tree, this.id, this.menu_id);
        this.load();
        if (window.attachEvent) {
            window.attachEvent("onunload", function (e) {
                self.save();
            }
            );
        }
        else if (window.addEventListener) {
            window.addEventListener("unload", function (e) {
                self.save();
            }
            , false);
        }
    }
    this.parse = function (nodes, tree, id) {
        for (var i = 0; i < nodes.length; i++) {
            if (nodes[i].nodeType != 1) {
                continue;
            }
            if (nodes[i].className) {
                if ("box1" == nodes[i].className.substr(0, 4)) {
                    nodes[i].id = id + "-" + tree.length;
                    tree[tree.length] =  new Array();
                    eval('nodes[i].onmouseover = function() { self.box1over("' + nodes[i].id + '"); }');
                    eval('nodes[i].onmouseout = function() { self.box1out("' + nodes[i].id + '"); }');
                    eval('nodes[i].onclick = function() { self.box1click("' + nodes[i].id + '"); }');
                }
                if ("section" == nodes[i].className) {
                    id = id + "-" + (tree.length - 1);
                    nodes[i].id = id + "-section";
                    tree = tree[tree.length - 1];
                }
                if ("box2" == nodes[i].className.substr(0, 4)) {
                    nodes[i].id = id + "-" + tree.length;
                    tree[tree.length] =  new Array();
                    eval('nodes[i].onmouseover = function() { self.box2over("' + nodes[i].id + '", "' + nodes[i].className + '"); }');
                    eval('nodes[i].onmouseout = function() { self.box2out("' + nodes[i].id + '", "' + nodes[i].className + '"); }');
                }
            }
            if (this.highlightActive && nodes[i].tagName && nodes[i].tagName == "A") {
                if (document.location.href == nodes[i].href) {
                    nodes[i].className = (nodes[i].className ? ' active' : 'active');
                }
            }
            if (nodes[i].childNodes) {
                this.parse(nodes[i].childNodes, tree, id);
            }
        }
    }
    this.box1over = function (id) {
        if (!this.box1Hover)return;
        if (!document.getElementById(id))return;
        document.getElementById(id).className = (this.id_openbox == id ? "box1-open-hover" : "box1-hover");
    }
    this.box1out = function (id) {
        if (!this.box1Hover)return;
        if (!document.getElementById(id))return;
        document.getElementById(id).className = (this.id_openbox == id ? "box1-open" : "box1");
    }
    this.box1click = function (id) {
        if (!document.getElementById(id)) {
            return;
        }
        var id_openbox = this.id_openbox;
        if (this.id_openbox) {
            if (!document.getElementById(id + "-section")) {
                return;
            }
            this.hide();
            if (id_openbox == id) {
                if (this.box1hover) {
                    document.getElementById(id_openbox).className = "box1-hover";
                }
                else {
                    document.getElementById(id_openbox).className = "box1";
                }
            }
            else {
                document.getElementById(id_openbox).className = "box1";
            }
        }
        if (id_openbox != id) {
            this.show(id);
            var className = document.getElementById(id).className;
            if ("box1-hover" == className) {
                document.getElementById(id).className = "box1-open-hover";
            }
            if ("box1" == className) {
                document.getElementById(id).className = "box1-open";
            }
        }
    }
    this.box2over = function (id, className) {
        if (!this.box2Hover)return;
        if (!document.getElementById(id))return;
        document.getElementById(id).className = className + "-hover";
    }
    this.box2out = function (id, className) {
        if (!this.box2Hover)return;
        if (!document.getElementById(id))return;
        document.getElementById(id).className = className;
    }
    this.show = function (show_menu) {
        if (document.getElementById(show_menu + "-section")) {
			document.getElementById(show_menu + "-section").style.display = "block";
            this.id_openbox = show_menu;
        }
    }
    this.hide = function () {
        document.getElementById(this.id_openbox + "-section").style.display = "none";
        this.id_openbox = "";
    }
    this.save = function () {
        if (this.id_openbox) {
            this.cookie.set(this.id, this.id_openbox);
        }
        else {
            // this.cookie.del(this.id);
        }
    }
    this.load = function () {
		//var id_openbox = this.cookie.get(this.id);
        var id_openbox = show_menu;
		if (id_openbox) {
            this.show(id_openbox);
            document.getElementById(id_openbox).className = "box1-open";
        }
    }
    function Cookie() {
        this.get = function (name) {
            var cookies = document.cookie.split(";");
            for (var i = 0; i < cookies.length; i++) {
                var a = cookies[i].split("=");
                if (a.length == 2) {
                    a[0] = a[0].trim();
                    a[1] = a[1].trim();
                    if (a[0] == name) {
                        return unescape(a[1]);
                    }
                }
            }
            return "";
        }
        this.set = function (name, value) {
            document.cookie = name + "=" + escape(value);
        }
        this.del = function (name) {
            document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT";
        }
    }
    var self = this;
    this.id = id;
    this.tree =  new Array();
    this.cookie =  new Cookie();
    this.id_openbox = "";
}
if (typeof String.prototype.trim == "undefined") {
    String.prototype.trim = function () {
        var s = this.replace(/^\s*/, "");
        return s.replace(/\s*$/, "");
    }
}

////////////////////// ClickHideshowmenu.js  **********************************************************************
////////////////////// AjaxTabs.js  **********************************************************************
//Change Log:
//* Updated: July 11th, 07: Fixed bug with persistence not working. Doh.
//* Updated: July 9th, 07: Added session only persistence to tabs (set "enabletabpersistence" var below). Only .js file changed.
//* Updated Nov 8th, 06. Ability to select a tab dynamically, by calling a method (ie: via a link). Only .js file changed.

var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadstatustext="<img src='/images/loading.gif' /> Requesting content..."
var enabletabpersistence=1 //enable tab persistence via session only cookies, so selected tab is remembered (1=yes, 0=no)?

////NO NEED TO EDIT BELOW////////////////////////
var loadedobjects=""
var defaultcontentarray=new Object()
var bustcacheparameter=""

function ajaxpage(url, containerid, targetobj){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, IE7, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
var ullist=targetobj.parentNode.parentNode.getElementsByTagName("li")
for (var i=0; i<ullist.length; i++)
ullist[i].className=""  //deselect all tabs
targetobj.parentNode.className="selected"  //highlight currently clicked on tab
if (url.indexOf("#default")!=-1){ //if simply show default content within container (verus fetch it via ajax)
document.getElementById(containerid).innerHTML=defaultcontentarray[containerid]
return
}
document.getElementById(containerid).innerHTML=loadstatustext
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}

function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}

function loadobjs(revattribute){
if (revattribute!=null && revattribute!=""){ //if "rev" attribute is defined (load external .js or .css files)
var objectlist=revattribute.split(/\s*,\s*/) //split the files and store as array
for (var i=0; i<objectlist.length; i++){
var file=objectlist[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}
}

function expandtab(tabcontentid, tabnumber){ //interface for selecting a tab (plus expand corresponding content)
var thetab=document.getElementById(tabcontentid).getElementsByTagName("a")[tabnumber]
if (thetab.getAttribute("rel")){
ajaxpage(thetab.getAttribute("href"), thetab.getAttribute("rel"), thetab)
loadobjs(thetab.getAttribute("rev"))
}
}

function savedefaultcontent(contentid){// save default ajax tab content
if (typeof defaultcontentarray[contentid]=="undefined") //if default content hasn't already been saved
defaultcontentarray[contentid]=document.getElementById(contentid).innerHTML
}

function startajaxtabs(){
for (var i=0; i<arguments.length; i++){ //loop through passed UL ids
var ulobj=document.getElementById(arguments[i])
var ulist=ulobj.getElementsByTagName("li") //array containing the LI elements within UL
var persisttabindex=(enabletabpersistence==1)? parseInt(getCookie(arguments[i])) : "" //get index of persisted tab (if applicable)
var isvalidpersist=(persisttabindex<ulist.length)? true : false //check if persisted tab index falls within range of defined tabs
for (var x=0; x<ulist.length; x++){ //loop through each LI element
var ulistlink=ulist[x].getElementsByTagName("a")[0]
ulistlink.index=x
if (ulistlink.getAttribute("rel")){
var modifiedurl=ulistlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/")
ulistlink.setAttribute("href", modifiedurl) //replace URL's root domain with dynamic root domain, for ajax security sake
savedefaultcontent(ulistlink.getAttribute("rel")) //save default ajax tab content
ulistlink.onclick=function(){
ajaxpage(this.getAttribute("href"), this.getAttribute("rel"), this)
loadobjs(this.getAttribute("rev"))
saveselectedtabindex(this.parentNode.parentNode.id, this.index)
return false
}
if ((enabletabpersistence==1 && persisttabindex<ulist.length && x==persisttabindex) || (enabletabpersistence==0 && ulist[x].className=="selected")){
ajaxpage(ulistlink.getAttribute("href"), ulistlink.getAttribute("rel"), ulistlink) //auto load currenly selected tab content
loadobjs(ulistlink.getAttribute("rev")) //auto load any accompanying .js and .css files
}
}
}
}
}

////////////Persistence related functions//////////////////////////

function saveselectedtabindex(ulid, index){ //remember currently selected tab (based on order relative to other tabs)
if (enabletabpersistence==1) //if persistence feature turned on
setCookie(ulid, index)
}

function getCookie(Name){ 
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
//return document.cookie.match(re)[0].split("=")[1] //return its value  :: commented by shakeer::
return ""
}

function setCookie(name, value){
document.cookie = name+"="+value //cookie value is domain wide (path=/)
}
////////////////////// AjaxTabs.js  **********************************************************************


/* bookmark script ***********/
function setAsHome()
{if(navigator.appName.indexOf('Microsoft')!=-1)
{bookmarksite('Landmark Bingo','http://www.landmarkbing.co.uk')}
else if(navigator.appName.indexOf('Netscape')!=-1)
{var msg="Just drag this link onto your 'home' ";msg+="button to set this page as your ";msg+="default homepage!";alert(msg);}
else if(navigator.appName.indexOf('Opera')!=-1)
{var msg="Please go to Tools - Preferences ";msg+="- General and click 'Use current' ";msg+="to set this as your homepage! ";alert(msg);}
else
{var msg="Sorry, your browser doesn't allow ";msg+="scripts to set the default homepage. ";msg+="Please use your browser's 'options' dialog ";msg+="to do it! Thank you for your patience. ";alert(msg);}}
function addfav(){if(document.all)
window.external.AddFavorite(location.href,document.title);else if(window.sidebar)
window.sidebar.addPanel(document.title,location.href,"")}
/* bookmark script end ***********/
