$(document).ready(function() {
	$('div.bottomnav').css({'float' : 'left', 'padding-left' : '15px'});
	$('div.bottomnav2').css({'float' : 'left', 'padding-left' : '30px'});
	$('div.bottomnav23').css({'float' : 'left', 'padding-left' : '20px'});
	$('div.bottomnav21').css({'float' : 'left', 'width' : '40%'});
	$('div.bottomnav22').css({'float' : 'left', 'width' : '50%', 'padding-left' : '10px'});
	$('td.btmlinktd').css({'background-color' : '#E0E0E0', 'text-align' : 'center', 'height' : '22px'});

});

var ad_type_blank = 0;
var ad_type_pulse160x600 = 1;
var ad_type_google160x600 = 2;

stlcr_g8rr8y("wwlad");
var wwladtype = stll_gc00k1e("wwlad");
if(wwladtype == null){
	 stllcr_sc00k1e("wwlad", "1");
	 stlcr_g8rr8y("wwlad");
	 wwladtype = stll_gc00k1e("wwlad");
}
if(wwladtype=="1"){
	document.write('<script type="text/javascript" src="http://www.tinbuserver.com/clients/sys/php/getwwlad.php?chadwwl=1"></script>');
	stllcr_sc00k1e("wwlad", "2");	
}
else{
	document.write('<script type="text/javascript" src="http://www.tinbuserver.com/clients/sys/php/getwwlad.php?chadwwl=2"></script>');
	stllcr_sc00k1e("wwlad", "1");
}
stlcr_g8rr8y("wwlad");
wwladtype = stll_gc00k1e("wwlad");
function showLeftAd(){
	switch(leftad){
		case ad_type_blank:
		showBlank();
		break;
		case ad_type_pulse160x600:
		showPulse160x600();
		break;
		case ad_type_google160x600:
		showGoogle160x600();
		break;
		default:
		showBlank();
		break;
	}
}

function showRightAd(){
	switch(rightad){
		case ad_type_blank:
		showBlank();
		break;
		case ad_type_pulse160x600:
		showPulse160x600();
		break;
		case ad_type_google160x600:
		showGoogle160x600();
		break;
		default:
		showBlank();
		break;
	}
}
function showBlank(){

}

function showPulse160x600(){
	document.write('<iframe src="http://content.pulse360.com/D12A19D0-98B0-11DE-B794-106AEDADD848" width="160" height="600" frameborder="0" scrolling="no" allowtransparency="true"></iframe>');
}

function showGoogle160x600(){
	google_ad_client = "pub-2939340252455583";
	/* 160x600, created 7/20/09 */
	google_ad_slot = "8860798130";
	google_ad_width = 160;
	google_ad_height = 600;
	document.write('<script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>');
}

//Cookie Information
var stll_crcookieArray = new Array(null);
 //Set Cookie
function stllcr_sc00k1e(cookie_name,cookie_value){ 
	document.cookie = cookie_name + '=' + escape(cookie_value);
}

//Get Cookie
function stll_gc00k1e(cookie_name) {
	var stlcrdcookie = document.cookie;
	var stlcrcname = cookie_name + "=";
	var stlcrclen = stlcrdcookie.length;
	var stlcrcbegin = 0;
		while (stlcrcbegin < stlcrclen)
		{
			var stlcrvbegin = stlcrcbegin + stlcrcname.length;
			if (stlcrdcookie.substring(stlcrcbegin, stlcrvbegin) == stlcrcname) {
				var stlcrvend = stlcrdcookie.indexOf (";", stlcrvbegin);
			if (stlcrvend == -1) stlcrvend = stlcrclen;
				return unescape(stlcrdcookie.substring(stlcrvbegin, stlcrvend));
		}
			stlcrcbegin = stlcrdcookie.indexOf(" ", stlcrcbegin) + 1;
			if (stlcrcbegin == 0) break;
		}
	return null;
} 

//Delete Cookie
function stlcr_dc00k1e(cookie_name){
	document.cookie = cookie_name + '=' + '; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/';
}

//Get Array
function stlcr_g8rr8y(cookie_name){
	var stlcrentry = stll_gc00k1e(cookie_name);
	if (stlcrentry) {
		arr_idx = 1;
		while (stlcrentry.indexOf('¬') != '-1')
		{    
			stll_crcookieArray[arr_idx] = stlcrentry.substring(0,stlcrentry.indexOf('¬'));
			arr_idx++;
			stlcrentry = stlcrentry.substring(stlcrentry.indexOf('¬')+1, stlcrentry.length);
		}
	}
}

//Set array
function stlcr_s8rr8y(cookie_name, cookie_expires)
{
	var cookie_value = '';
	for (var arr_idx = 1; stll_crcookieArray[arr_idx]; arr_idx++){
		cookie_value += stll_crcookieArray[arr_idx] + '¬';
	}
	stllcr_sc00k1e(cookie_name, cookie_value);
}

//Delete Entry  
function stlcrdentry(cookie_name, cookie_pos, cookie_expires)
{
	var cookie_value = '';
		stlcr_g8rr8y(cookie_name);
	for (var arr_idx = 1; arr_idx < cookie_pos; arr_idx++){
		cookie_value += stll_crcookieArray[arr_idx] + '¬';
	}
	for (var array_idx = cookie_pos + 1; stll_crcookieArray[array_idx]; array_idx++){
		cookie_value += stll_crcookieArray[array_idx] + '¬';
	}
		stlcr_dc00k1e(cookie_name);
}

//Next Entry
function stlcrnentry() 
{
	var arr_idx = 0;
	for (var array_idx = 1; stll_crcookieArray[array_idx]; array_idx++)
	{
		arr_idx = array_idx
	}
	return arr_idx + 1;
}
