// JavaScript Document

// google analytics code
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {

var pageTracker = _gat._getTracker("UA-7936818-6");

pageTracker._trackPageview();

} catch(err) {}
// google analytics code end here
	


function addvalue(id){
			document.getElementById("category").value =id;
			document.getElementById("category_input").value = document.getElementById("option_"+id).value ;
			document.getElementById("list1").style.display="none";
}

function addvalue2(id){
		 	var id1 = id.replace("sub_cat_id_","");
			document.getElementById("sub-category").value = id1;
			document.getElementById("sub-cat").value = document.getElementById("sub_cat_"+id1).value ;
			document.getElementById("list2").style.display="none";
}


function showComolist(){
								
							var list = new Array()
							list[0]="Az - Bz";	
							list[1]="Cz - Dz";
							list[2]="Ez - Fz";
							list[3]="Gz - Hz";
							list[4]="Iz - Jz";
							list[5]="Kz - Lz";
							list[6]="Mz - Nz";
							list[7]="Oz - Pz";
							list[8]="Qz - Rz";
							list[9]="Sz - Tz";
							list[10]="Uz - Vz";
							list[11]="Wz - Xz";
							list[12]="Yz - Zz";
							
							var combolist = "";
							for(i=0;i<=list.length-1;i++){
								combolist = combolist + "<li><a href='#' id='"+list[i]+"' onclick='addvalue(this.id)' >" + list[i] + "</a></li>\n";
							}
	return combolist;
}
function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}
	
function setCookie(c_name,value)
{
	document.cookie=c_name+ "=" +escape(value);
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
}

function geturl(rowid)
	{
		// ajax to fetch keyword count
		advAJAX.get({
			url: "config/dbconfig.php?QT=32&RowId="+rowid,
			
		onInitialization : function() {
		}, 
		onSuccess : function(obj) {
		//document.getElementById("gurl").innerHTML=obj.responseText;
			window.open(obj.responseText,'_blank')
		},
		onError : function(obj) {	
			/* In case of error we show an alert */
			alert("Error: " + obj.status);
		},
		onFinalization : function(obj){ 
		}
	});	

}