/*pop up window function*/

function popwin(img, zw, zh)
{
    var generator=window.open('','name', 'height='+zh+' ,width =' + zw);  
    generator.document.write('<html><head><title>Inquirer.net</title>');
    generator.document.write('</head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
    generator.document.write('<div align="center" id="zoomimg"><img src="'+img+'" border="0"></div>');
    generator.document.write('</body></html>');
    generator.document.close();
}


function popvid(vidsrc, vidtitle, vidcaption, zw, zh)
{
    var generator=window.open('','name', 'height='+zh+' ,width =' + zw);  
    generator.document.write('<html><head><title>Inquirer.net</title>');
    generator.document.write('</head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
    generator.document.write('<div align="center" style="width:425px; margin:0 auto;">');
    generator.document.write('<h3>' + vidtitle + '</h3>');
    generator.document.write('<object width="425" height="350">');
    generator.document.write('<param name="movie" value="'+ vidsrc +'">');
    generator.document.write('</param>');
    generator.document.write('<param name="wmode" value="transparent">');
    generator.document.write('</param>');
    generator.document.write('<embed src="' + vidsrc + '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>');
    generator.document.write('<p class="vidcap">'+ vidcaption  +'</p>');
    generator.document.write('</div>');
    generator.document.write('</body></html>');
    generator.document.close();
}


function popVU(vidsrc, vidcaption, zw, zh)
{
    var generator=window.open('','name', 'height='+zh+' ,width =' + zw);  
    generator.document.write('<html><head><title>Inquirer.net</title>');
    generator.document.write('</head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');

    generator.document.write('<div align="center" style="width:425px; margin:0 auto;">');
    generator.document.write('<h3>Inquirer.net Video</h3>');
    
    generator.document.write('<embed src="'+ vidsrc +'" width="540" height="438" bgcolor="#000000" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
    generator.document.write('<br/><a href="http://www.veoh.com/">Online Videos by Veoh.com</a>');
    generator.document.write('<p class="vidcap">'+ vidcaption  +'</p>');

    generator.document.write('</body></html>');
    generator.document.close();
}

function popUT(vidsrc, vidcaption, zw, zh)
{
    var generator=window.open('','name', 'height='+zh+' ,width =' + zw);  
    generator.document.write('<html><head><title>Inquirer.net</title>');
    generator.document.write('</head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');

    generator.document.write('<div align="center" style="width:425px; margin:0 auto;">');
    generator.document.write('<h3>Inquirer.net Video</h3>');
    generator.document.write('<object width="425" height="350">');
    generator.document.write('<param name="movie" value="'+ vidsrc +'></param>');
    generator.document.write('<param name="wmode" value="transparent"></param>');
    generator.document.write('<embed src="'+ vidsrc +'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>');
    generator.document.write('</object>');
    generator.document.write('</div>');
    generator.document.write('<p class="vidcap">'+ vidcaption  +'</p>');

    generator.document.write('</body></html>');
    generator.document.close();

}

/*OAS Central*/
var oas='http://oascentral.inq7.net/RealMedia/ads/';
var RN = new String (Math.random());
var RNS = RN.substring (2, 11);
function DisplayAds (sitepage, position)
{
	var oaspage= sitepage + '/1' + RNS + '@' + position;

	if (_version < 11) {
		document.write ('<a href="' + oas + 'click_nx.ads/'+ oaspage + '" target="_top" ><img src="' + oas + 'adstream_nx.ads/' + oaspage + '" border="0"/></a>');
	}
	else {
		document.write ('<script type="text/javascript" src="' + oas + 'adstream_jx.ads/' + oaspage + '">');
		document.write ('\<\!-- --\>');
		document.write ('\<\/script\>');
		document.write ('\<\!-- --\>');
	}
}

/*Get Tag Clouds Function*/
var xmlHttp
function showTag(str)
{
	if (str.length==0)
	{ 
		document.getElementById("tagcloud").innerHTML=""
		return
	}
	
	xmlHttp=GetXmlHttpObject()
	
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return;
	} 
	
		var url="../../tagcloud/tagcloudbox.php?channel="

		url=url+str
	
		xmlHttp.onreadystatechange=stateChanged 
		xmlHttp.open("GET",url)
		xmlHttp.send(null)
} 

function showartTag(str)
{
	if (str.length==0)
	{ 
		document.getElementById("tagcloud").innerHTML=""
		return
	}
	
	xmlHttp=GetXmlHttpObject()
	
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return;
	} 
	
		var url="../../tagcloud/tagcloudbox_art.php?channel="

		url=url+str
	
		xmlHttp.onreadystatechange=stateChanged 
		xmlHttp.open("GET",url)
		xmlHttp.send(null)
} 

function stateChanged() 
{ 
	if (xmlHttp.readyState == 4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("tagcloud").innerHTML=xmlHttp.responseText 		
	} 
	
	
} 

function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	
	if (window.XMLHttpRequest)
	{
		objXMLHttp= new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp= new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}

/*BookMark Function*/
function callhomebook(a){

	if (document.all){	  
	  a.style.behavior='url(#default#homepage)';a.setHomePage('http://www.inquirer.net');
	}
	else {// If it's any other browser, bookmark!
		
		var t = ' Homepage - Inquirer.net';
		var u=  'http://www.inquirer.net/';
	 
	    if (window.sidebar) 
	    { 
	           window.sidebar.addPanel(t, u,""); 
	    }
	    else if( document.all ) 
	    {
	           window.external.AddFavorite(u, t);
	    } 
	    else if( window.opera && window.print ) 
	    {
	      return true;
	    }
	}
}

/*AJAX function*/
var rootdomain="http://"+window.location.hostname

function ajaxinclude(url) {
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, 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
page_request.open('GET', url, false) //get page synchronously 
page_request.send(null)
writecontent(page_request)
}

function writecontent(page_request){
if (window.location.href.indexOf("http")==-1 || page_request.status==200)
document.write(page_request.responseText)
}

/*Resize Text*/
function textsize(size){
		var el = new Array('', '', '', '', '', '', '', '');
		if(size == 'sml'){
			document.getElementById('article').style.fontSize = '11px';
 		}
		if(size == 'med'){
			document.getElementById('article').style.fontSize = '14px';
		}
		if(size == 'lrg'){
			document.getElementById('article').style.fontSize = '16px';
		}
	}
	
/*Ticker Script*/
function changeTick()
	{
	ct++;
	if (ct>=tl) ct=0;
	tk.href = tlink[ct];
	runTick(0);
	}

function runTick(cl)
	{
	nv = new String();
	nl = thead[ct].length+1;
	
	if (cl<nl)
		{
		nv = thead[ct].substring(0,cl);
		tk.innerHTML = nv + "_";
		cl++;
		setTimeout('runTick("' + cl + '")',75);
		}
		else
		{
		setTimeout('changeTick()',5000);	
		}

	}


function openDir( form ) {
            var newIndex = form.fieldname.selectedIndex;
            if ( newIndex == 0 ) {
                alert( "Please select a location!" );
            } else {
                cururl = form.fieldname.options[ newIndex ].value;
                window.location.assign( cururl );
    }
}

function poptagdef(){
	
	var generator=window.open('','name', 'height=351 ,width = 300');  
    htm = '<html><head><title>Hottest Tags - What\'s This?</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style>body{	width:300px;	height:351px;	margin:0;	padding:0;	font-family:Arial, Verdana, Helvetica, sans-serif;	font-size:11px;	background:url(http://images.inquirer.net/images/hottest_tags_whats-this-bg.jpg) no-repeat;}#all{	width:260px;	margin:0 auto;}h1{	font-size:14px;	color:#0078FF;	margin:10px 0 0 0 0;padding:0;}#logo{	position:relative;	top:6px;}</style></head><body><div id="all"><h1>What are these <img src="http://images.inquirer.net/images/hottest_tags-logo.jpg" id="logo" alt="Hottest Tags" title="Hottest Tags" width="119" height="24" />?</h1>  <p>The <strong>Hottest Tag</strong> box or &quot;<strong>tag cloud</strong>&quot;     is a convenient way to find out which topics are getting the most coverage     on INQUIRER.net and keeping track of articles classified or &quot;tagged&quot;    under these topics.</p>  <p>All articles on INQUIRER.net are tagged before being posted and the Hottest     Tags box lists 20 tags that have at least one article classified under them     in the last 30 days, for the area of the site in which the box appears.</p> <p>Tags with more articles appear in larger type; tags with fewer articles     in smaller type. Bringing your mouse over a tag shows you the number of articles     classified under that tag and clicking on a tag leads you to a list of articles     under that tag.</p>  <p>To view more tags and a list that covers all areas of the site, click on     the &quot;More&quot; link under each Hottest Tag box.</p></div></body></html>   ';
    generator.document.write(htm);
    generator.document.close();
}



function poptagdefarticle(){

    var generator=window.open('','name', 'height=351 ,width = 300');
    htm = '<html><head><title>Hottest Tags - What\'s This?</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style>body{  width:300px;    height:351px;   margin:0;   padding:0;  font-family:Arial, Verdana, Helvetica, sans-serif;  font-size:11px; background:url(http://images.inquirer.net/images/hottest_tags_whats-this-bg.jpg) no-repeat;}#all{   width:260px;    margin:0 auto;}h1{  font-size:14px; color:#0078FF;  margin:10px 0 0 0 0;padding:0;}#logo{   position:relative;  top:6px;}</style></head><body><div id="all"><h1>What are these <img src="http://images.inquirer.net/images/hottest_tags-logo.jpg" id="logo" alt="Hottest Tags" title="Hottest Tags" width="119" height="24" />?</h1>  <p>The <strong>Hottest Tag</strong> box or &quot;<strong>tag cloud</strong>&quot;     is a convenient way to find out which topics are getting the most coverage on INQUIRER.net and keeping track of articles classified or &quot;tagged&quot;    under these topics.</p>  <p>All articles on INQUIRER.net are tagged before being posted and the Hottest Tags box next to an article shows the keywords under which the article has been classified.</p> <p>Tags with more articles appear in larger type; tags with fewer articles     in smaller type. Bringing your mouse over a tag shows you the number of articles     classified under that tag and clicking on a tag leads you to a list of articles     under that tag.</p>  <p>To view more tags and a list that covers all areas of the site, click on     the &quot;More&quot; link under each Hottest Tag box.</p></div></body></html>';
    generator.document.write(htm);
    generator.document.close();
}


