function xmlhttpPost(strURL,sig,divid,db) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText,sig,divid);
        }
    }
    self.xmlHttpReq.send(getquerystring(sig,db,divid));
}

function getquerystring(sig,db) {
    //var form     = document.forms['ajf'];
    //var vote = form.vote.value;
    var vote = sig;
    qstr = 'id=' + escape(vote) + '&db=' + escape(db);  // NOTE: no '?' before querystring
    return qstr;
}

function updatepage(str,sig,divid){
	var countbox = "com" + divid;
    document.getElementById(countbox).innerHTML = str;
}


//############################

function xmlhttpUpdate(strURL,sig,divid,db,user) {
    var xmlHttpReq = false;
    var self = this;
 	var divid = divid.toString();
 	// Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepagetoo(self.xmlHttpReq.responseText,divid);
        }
    }
    self.xmlHttpReq.send(getquerystringtoo(sig,db,user,divid));
}

function getquerystringtoo(sig,db,user,divid) {
    //var form     = document.forms['ajf'];
    //var vote = form.vote.value;
    var vote = sig;
    qstr = 'id=' + escape(vote) + '&db=' + escape(db) + '&user=' + escape(user) + '&divid=' + escape(divid);  // NOTE: no '?' before querystring
    return qstr;
}

function updatepagetoo(str,divid){
	var countbox = divid;
    document.getElementById(countbox).innerHTML = str;
}


//############################


function shoh(id) { 
    
    if (document.getElementById) { // DOM3 = IE5, NS6
        if (document.getElementById(id).style.display == "none"){
            document.getElementById(id).style.display = 'block';
        } else {
            document.getElementById(id).style.display = 'none';         
        }   
    } else { 
        if (document.layers) {  
            if (document.id.display == "none"){
                document.id.display = 'block';
            } else {
                document.id.display = 'none';
            }
        } else {
            if (document.all.id.style.visibility == "none"){
                document.all.id.style.display = 'block';
            } else {
                document.all.id.style.display = 'none';
            }
        }
    }
}



//show funtion
function show(id) { 
    
    if (document.getElementById) { // DOM3 = IE5, NS6
            document.getElementById(id).style.display = 'block';
    } else { 
        if (document.layers) {  
                document.id.display = 'block';
        } else {
                document.all.id.style.display = 'block';
        }
    }
}

//hide funtion
function hide(id) { 
    if (document.getElementById) { // DOM3 = IE5, NS6
            document.getElementById(id).style.display = 'none';         
    } else { 
        if (document.layers) {  
                document.id.display = 'none';
        } else {
                document.all.id.style.display = 'none';
        }
    }
}


/*************************************************************
* NLB Background Color Fader v1.0
* Author: Justin Barlow - www.netlobo.com
*
* Description:
* The Background Color Fader allows you to gradually fade the
* background of any HTML element.
*
* Usage:
* Call the Background Color Fader as follows:
*   NLBfadeBg( elementId, startBgColor, endBgColor, fadeTime );
*
* Description of Parameters
*   elementId - The id of the element you wish to fade the
*             background of.
*   startBgColor - The background color you wish to start the
*             fade from.
*   endBgColor - The background color you want to fade to.
*   fadeTime - The duration of the fade in milliseconds.
*************************************************************/

var nlbFade_hextable = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' ]; // used for RGB to Hex and Hex to RGB conversions
var nlbFade_elemTable = new Array( ); // global array to keep track of faded elements
var nlbFade_t = new Array( ); // global array to keep track of fading timers
function NLBfadeBg( elementId, startBgColor, endBgColor, fadeTime )
{
	var timeBetweenSteps = Math.round( Math.max( fadeTime / 300, 30 ) );
	var nlbFade_elemTableId = nlbFade_elemTable.indexOf( elementId );
	if( nlbFade_elemTableId > -1 )
	{
		for( var i = 0; i < nlbFade_t[nlbFade_elemTableId].length; i++ )
			clearTimeout( nlbFade_t[nlbFade_elemTableId][i] );
	}
	else
	{
		nlbFade_elemTable.push( elementId );
		nlbFade_elemTableId = nlbFade_elemTable.indexOf( elementId );
	}
	var startBgColorRGB = hexToRGB( startBgColor );
	var endBgColorRGB = hexToRGB( endBgColor );
	var diffRGB = new Array( );
	for( var i = 0; i < 3; i++ )
		diffRGB[i] = endBgColorRGB[i] - startBgColorRGB[i];
	var steps = Math.ceil( fadeTime / timeBetweenSteps );
	var nlbFade_s = new Array( );
	for( var i = 1; i <= steps; i++ )
	{
		var changes = new Array( );
		for( var j = 0; j < diffRGB.length; j++ )
			changes[j] = startBgColorRGB[j] + Math.round( ( diffRGB[j] / steps ) * i );
		if( i == steps )
			nlbFade_s[i - 1] = setTimeout( 'document.getElementById("'+elementId+'").style.backgroundColor = "'+endBgColor+'";', timeBetweenSteps*(i-1) );
		else
			nlbFade_s[i - 1] = setTimeout( 'document.getElementById("'+elementId+'").style.backgroundColor = "'+RGBToHex( changes )+'";', timeBetweenSteps*(i-1) );
	}
	nlbFade_t[nlbFade_elemTableId] = nlbFade_s;
}
function hexToRGB( hexVal )
{
	hexVal = hexVal.toUpperCase( );
	if( hexVal.substring( 0, 1 ) == '#' )
		hexVal = hexVal.substring( 1 );
	var hexArray = new Array( );
	var rgbArray = new Array( );
	hexArray[0] = hexVal.substring( 0, 2 );
	hexArray[1] = hexVal.substring( 2, 4 );
	hexArray[2] = hexVal.substring( 4, 6 );
	for( var k = 0; k < hexArray.length; k++ )
	{
		var num = hexArray[k];
		var res = 0;
		var j = 0;
		for( var i = num.length - 1; i >= 0; i-- )
			res += parseInt( nlbFade_hextable.indexOf( num.charAt( i ) ) ) * Math.pow( 16, j++ );
		rgbArray[k] = res;
	}
	return rgbArray;
}
function RGBToHex( rgbArray )
{
	var retval = new Array( );
	for( var j = 0; j < rgbArray.length; j++ )
	{
		var result = new Array( );
		var val = rgbArray[j];
		var i = 0;
		while( val > 16 )
		{
			result[i++] = val%16;
			val = Math.floor( val/16 );
		}
		result[i++] = val%16;
		var out = '';
		for( var k = result.length - 1; k >= 0; k-- )
			out += nlbFade_hextable[result[k]];
		retval[j] = padLeft( out, '0', 2 );
	}
	out = '#';
	for( var i = 0; i < retval.length; i++ )
		out += retval[i];
	return out;
}
if (!Array.prototype.indexOf) {
	Array.prototype.indexOf = function( val, fromIndex ) {
		if( typeof( fromIndex ) != 'number' ) fromIndex = 0;
		for( var index = fromIndex, len = this.length; index < len; index++ )
			if( this[index] == val ) return index;
		return -1;
	}
}
function padLeft( string, character, paddedWidth )
{
	if( string.length >= paddedWidth )
		return string;
	else
	{
		while( string.length < paddedWidth )
			string = character + string;
	}
	return string;
}

/*************************************************************

*************************************************************/

var tic = 0;
var t;

function timedCount()
{

var now = servernow + tic;

var p1sec = 1195088340;
var p2sec = 1199149140;
var p3sec = 1193652000;

var diff1 = p1sec - now;
var diff2 = p2sec - now;
var diff3 = p3sec - now;

var daystp1 = Math.floor(diff1/(3600*24));
var hourstp1 = Math.floor((diff1 - daystp1*3600*24)/3600);
var mintp1 =Math.floor((diff1 - daystp1*3600*24 - hourstp1*3600)/60);
var sectp1 = Math.floor(diff1 - daystp1*3600*24 - hourstp1*3600 - mintp1*60);

if (daystp1 <= 0)
daystp1 = "0";
if (hourstp1 <= 0)
hourstp1 = "00";
if (mintp1 <= 0)
mintp1 = "00";
if (sectp1 <= 0)
sectp1 = "00";

if (hourstp1 <= 9 && hourstp1 != "00")
hourstp1 = "0" + hourstp1;
if (mintp1 <= 9 && mintp1 != "00")
mintp1 = "0" + mintp1;
if (sectp1 <= 9 && sectp1 != "00")
sectp1 = "0" + sectp1;

var daystp2 = Math.floor(diff2/(3600*24));
var hourstp2 = Math.floor((diff2 - daystp2*3600*24)/3600);
var mintp2 =Math.floor((diff2 - daystp2*3600*24 - hourstp2*3600)/60);
var sectp2 = Math.floor(diff2 - daystp2*3600*24 - hourstp2*3600 - mintp2*60);

if (daystp2 <= 0)
daystp2 = "0";
if (hourstp2 <= 0)
hourstp2 = "00";
if (mintp2 <= 0)
mintp2 = "00";
if (sectp2 <= 0)
sectp2 = "00";

if (hourstp2 <= 9 && hourstp2 != "00")
hourstp2 = "0" + hourstp2;
if (mintp2 <= 9 && mintp2 != "00")
mintp2 = "0" + mintp2;
if (sectp2 <= 9 && sectp2 != "00")
sectp2 = "0" + sectp2;

var daystp3 = Math.floor(diff3/(3600*24));
var hourstp3 = Math.floor((diff3 - daystp3*3600*24)/3600);
var mintp3 =Math.floor((diff3 - daystp3*3600*24 - hourstp3*3600)/60);
var sectp3 = Math.floor(diff3 - daystp3*3600*24 - hourstp3*3600 - mintp3*60);

if (daystp3 <= 0)
daystp3 = "0";
if (hourstp3 <= 0)
hourstp3 = "00";
if (mintp3 <= 0)
mintp3 = "00";
if (sectp3 <= 0)
sectp3 = "00";

if (hourstp3 <= 9 && hourstp3 != "00")
hourstp3 = "0" + hourstp3;
if (mintp3 <= 9 && mintp3 != "00")
mintp3 = "0" + mintp3;
if (sectp3 <= 9 && sectp3 != "00")
sectp3 = "0" + sectp3;

 
//var countdown1 = daystp1 +":"+ hourstp1 +":"+ mintp1 +":"+ sectp1;
var countdown1 = daystp1 +":"+ hourstp1 +":"+ mintp1;
var countdown2 = daystp2 +":"+ hourstp2 +":"+ mintp2;
var countdown3 = daystp3 +":"+ hourstp3 +":"+ mintp3;

//document.getElementById("cd1").innerHTML = countdown1;
document.getElementById("cd2").innerHTML = countdown2;
//document.getElementById("cd3").innerHTML = countdown3;

tic = tic + 1;
t=setTimeout("timedCount()",1000);
}

/*************************************************************

*************************************************************/

// Copyright 2006,2007 Bontrager Connection, LLC
// http://bontragerconnection.com/ and http://willmaster.com/
// Version: July 28, 2007
var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
	rX = self.pageXOffset;
	rY = self.pageYOffset;
	}
else if(document.documentElement && document.documentElement.scrollTop) {
	rX = document.documentElement.scrollLeft;
	rY = document.documentElement.scrollTop;
	}
else if(document.body) {
	rX = document.body.scrollLeft;
	rY = document.body.scrollTop;
	}
if(document.all) {
	cX += rX; 
	cY += rY;
	}
d.style.left = (cX-100) + "px";
d.style.top = (cY+10) + "px";
}
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
//AssignPosition(dd);
dd.style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
//AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}



