// JavaScript Document

function GSEARCH(){
	se=document.getElementById("gsearch").value;	
	cx="partner-pub-9521272850223893:622ibi-3zh4";
	cof="FORID:10";
	ie="ISO-8859-1";
	sa="search";
	q=se;
	if(se==""){
		q="mehndi+designs";
		location.href="http://urdu-mag.com/search.php?cx="+cx+"&cof="+cof+"&ie="+ie+"&q="+q+"&sa=Search";
	}else{
		location.href="http://urdu-mag.com/search.php?cx="+cx+"&cof="+cof+"&ie="+ie+"&q="+q+"&sa=Search";
	}
}

function SUBSCRIBE(){
	em=document.getElementById("subscribe").value;
	if(em!="" && em.indexOf("@")!=-1){
		pg=location.href;
		//location.href="http://urdu-mag.com/subscribe.php?email="+em+"&pg="+pg;
		window.open('http://feedburner.google.com/fb/a/mailverify?uri=urdumagazine&email='+em, 'popupwindow', 'scrollbars=yes,width=550,height=520');
	}
}

function CVIEW(im,f){
	window.open("largeview-icons.php?id="+im+"&f="+f,"LARGEVIEW","height=800,width=800");
}
function CVIEWi(n){
	window.open("largeview-custom-icons.php?id="+n,"LARGEVIEW","height=800,width=800");
}

function VVIEW(im){
	window.open("largeview.php?id="+im,"LARGEVIEW","height=800,width=800");
}
function CR(){
	w=screen.width;
	if(w>2000){
		document.getElementById("verticalad").style.display="block";
	}
}
function TBG(t){
		ct = document.getElementById("ctable_"+t).style;
		ct.background="#F9F9F9";		
		ct.border="dashed 1px #D25A0B";
}

function TBGN(t){
		ct = document.getElementById("ctable_"+t).style;
		ct.background="#FFFFFF";		
		ct.border="dashed 1px #FFFFFF";		
}
function TBGNB(t){
		ct = document.getElementById("ctable_"+t).style;
		ct.background="#FFFFFF";		
		ct.border="dashed 1px #d5d5d5";		
}


function PGNAME(){
	pg = location.href;
	document.getElementById("pg").value=pg;
}

function CHEX(){
	aids="";
	tloop=document.getElementById("tloop").value;
	for(a=0;a<tloop;a++){
		if(document.getElementById("articleno_"+a).checked){
			aids = aids + document.getElementById("articleno_"+a).value +",";
		}
	}
	if(aids=="") return false;
	document.getElementById("articlesids").value=aids.substring(0,aids.length-1);
	if(document.getElementById("sendemail").value!="" && document.getElementById("sendemail").value.indexOf("@")==-1){
		return false;
	}
}

function LD(s){
	if(s=="") return;
	if(s.indexOf("sid")){
		location.href="articles.php?"+s;
	}else{
		location.href="corner.php?"+s;
	}
}

function LDW(s){
	if(s=="") return;
	if(s.indexOf("sid")==-1){
		location.href="web-directories-listing.php?"+s;
	}else{
		location.href="web-directories.php?"+s;
	}
}

function ULOADSUBCAT(cid,sid)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="../include/getsubcat.php";
url=url+"?cid="+cid+"&sid="+sid;
document.getElementById("subcat").innerHTML="<img src='../images/loading.gif' width='25' height='20'>";
xmlHttp.onreadystatechange=stateChanged1;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged1(){ 
	if (xmlHttp.readyState==4){ 
		document.getElementById("subcat").innerHTML=xmlHttp.responseText;
	}
}


function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

