var ProgArr=new Array();
ProgArr[0]="chartpcresults.jsp";
ProgArr[1]="chartelectrol.jsp";
ProgArr[2]="chartpcanalysis.jsp";
ProgArr[3]="chartperf.jsp";
ProgArr[4]="chartseats2d.jsp";
ProgArr[5]="chartseattype.jsp";
ProgArr[6]="chartturnout.jsp";
ProgArr[7]="chartvotes2d.jsp";

function CallProgen(DID)
{
	for(var i=0;i<8;i++)
	{
		if(i==DID)
		{
			document.getElementById("Progen").src="http://ballot.progenbusiness.com/"+ProgArr[i];
		}
		else
		{
		}	
	}
}

function getPageSize()
{

    var xScroll, yScroll;

    if (window.innerHeight && window.scrollMaxY) 
	{
        xScroll = document.body.scrollWidth;
        yScroll = window.innerHeight + window.scrollMaxY;
    } 
	else if (document.body.scrollHeight > document.body.offsetHeight)
	{ 
		// all but Explorer Mac
        xScroll = document.body.scrollWidth;
        yScroll = document.body.scrollHeight;
    } 
	else 
	{ 
		// Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
        xScroll = document.body.offsetWidth;
        yScroll = document.body.offsetHeight;
    }
	
    var windowWidth, windowHeight;
    
	if (self.innerHeight) 
	{   
		// all except Explorer
        windowWidth = self.innerWidth;
        windowHeight = self.innerHeight;
    } 
	else if (document.documentElement && document.documentElement.clientHeight) 
	{ 
		// Explorer 6 Strict Mode
        windowWidth = document.documentElement.clientWidth;
        windowHeight = document.documentElement.clientHeight;
    } 
	else if (document.body) 
	{ 
		// other Explorers
        windowWidth = document.body.clientWidth;
        windowHeight = document.body.clientHeight;
    }

    // for small pages with total height less then height of the viewport
    if(yScroll < windowHeight)
	{
        pageHeight = windowHeight;
    } 
	else 
	{
        pageHeight = yScroll;
    }

    // for small pages with total width less then width of the viewport
    if(xScroll < windowWidth)
	{
        pageWidth = windowWidth;
    } 
	else 
	{
        pageWidth = xScroll;
    }
    document.getElementById('fade_help').style.height=pageHeight+"px";
    document.getElementById('fade_help').style.width=pageWidth+"px";

}

function playNewsVideo(linkurl)
{
	getPageSize();
	document.getElementById('light').style.display='block';
	document.getElementById('fade_help').style.display='block';
	
	document.getElementById('light').innerHTML="<div style='background:#999; border:1px solid #666; text-align:right; padding:2px; width:435px;'><a href='#' onclick=document.getElementById('light').style.display='none';document.getElementById('fade_help').style.display='none';document.getElementById('light').innerHTML=''; ><img src='../images/close.png' border='0'></a></div>";
	document.getElementById('light').innerHTML+='<embed src="http://www.mypopkorn.com/player/embed/smallPlayer.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" allowFullScreen="true" type="application/x-shockwave-flash" width="440" height="369"	FlashVars="flashdata=||'+ linkurl +' "></embed>';

}


function playNewsVideoBlinkx(embed_tag)
{
	getPageSize();
	document.getElementById('light').style.display='block';
	document.getElementById('fade_help').style.display='block';
	
	document.getElementById('light').innerHTML="<div style='background:#999; border:1px solid #666; text-align:right; padding:2px; width:435px;'><a href='#' onclick=document.getElementById('light').style.display='none';document.getElementById('fade_help').style.display='none';document.getElementById('light').innerHTML=''; ><img src='../images/close.png' border='0'></a></div>";
	
	document.getElementById('light').innerHTML+=embed_tag;

}


function showImage(linkurl)
{
	getPageSize();
	document.getElementById('light').style.display='block';
	document.getElementById('fade_help').style.display='block';
	
	document.getElementById('light').innerHTML="<div style='background:#999; border:1px solid #666; text-align:right; padding:2px; width:435px;'><a href='#' onclick=document.getElementById('light').style.display='none';document.getElementById('fade_help').style.display='none'; ><img src='../images/close.png' border='0'></a>";
	document.getElementById('light').innerHTML+='<img src="'+linkurl+'" border="0" width="440" height="369"></div>';
	
}

function morequotes(div,offset,limit)
{
	callAjax( div, "election_quotes.php", {
		params:"offset="+offset+"&limit="+limit,
		meth:"post",
		async:true,
		//startfunc:data_loading(div,''),
		//endfunc:document.getElementById('offset').value=(document.getElementById('offset').value*1)+4,
		errorfunc:"" });
	
}		
