<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


function dispdivall(k){
	for (var i = 0; i<top_links_count; i++){
		if(k==i){
			document.getElementById("subli"+k).style.display = "block";
			document.getElementById("menutd"+k).style.backgroundColor = "#77A7D7";
		}
		else{
			document.getElementById("subli"+i).style.display = "none";
			document.getElementById("menutd"+i).style.backgroundColor = "#BAD1F1";
		}
	}
}
	
	
function SwitchMenu(obj){
	for (var i in SwitchMenuOptions){
		var current = SwitchMenuOptions[i];
		try{
			if(obj==current){
				document.getElementById(current).style.display='block';
			}
			else{
				document.getElementById(current).style.display='none';
			}
		}
		catch(e){}
	}
}


function dispdiv1()
	{
	document.getElementById("news1").style.display = "block";
	document.getElementById("news2").style.display = "none";
	document.getElementById("news3").style.display = "none";
	document.Image30.src="images/newsandviewso.jpg";
	document.Image33.src="images/mostpopular.jpg";
	document.Image32.src="images/worldnews.jpg";
	}
function dispdiv2()
	{
	document.getElementById("news1").style.display = "none";
	document.getElementById("news2").style.display = "block";
	document.getElementById("news3").style.display = "none";
	document.Image33.src="images/mostpopular0.jpg";
	document.Image30.src="images/newsandviewsb.jpg";
	document.Image32.src="images/worldnews.jpg";
	}
function dispdiv3()
	{
	document.getElementById("news1").style.display = "none";
	document.getElementById("news2").style.display = "none";
	document.getElementById("news3").style.display = "block";
	document.Image32.src="images/worldnewso.jpg";
	document.Image33.src="images/mostpopular.jpg";
	document.Image30.src="images/newsandviewsb.jpg";
	}
function showPoll()
	{
	document.getElementById("Poll").style.display = "block";
	document.getElementById("CF").style.display   = "none";
	document.getElementById("CMT").style.display  = "none";
	}
function showCF()
	{
	document.getElementById("Poll").style.display = "none";
	document.getElementById("CF").style.display   = "block";
	document.getElementById("CMT").style.display  = "none";
	}
function showCMT()
	{
	document.getElementById("Poll").style.display = "none";
	document.getElementById("CF").style.display   = "none";
	document.getElementById("CMT").style.display  = "block";
	}	
function showVoteOption()
	{
	document.getElementById("Vote").style.display   = "block";
	document.getElementById("VResult").style.display  = "none";
	}	
function showVoteResult()
	{
	document.getElementById("Vote").style.display   = "none";
	document.getElementById("VResult").style.display  = "block";
	}			
function checkVote() {
	count = document.formPoll.poll_option_id.length;
	pollSelect = false;
	for(i = 0; i < count; ++i) {
		if(document.formPoll.poll_option_id[i].checked) {
			pollSelect = true;
			break;
		}
	}
	if(!pollSelect) {
		alert("Select an answer to vote");
		return false;
	}
	
	document.formPoll.action ='index.php';
	document.formPoll.frmAction.value = 'Vote';
	document.formPoll.submit();
}
function chimageqans()
	{
	document.getElementById('linksre').style.background='url(images/links_resorces.jpg)';
	document.getElementById('liandre').style.display = "none";
	document.getElementById('qands').style.background='url(images/qandans_h.jpg)';
	document.getElementById('qandans').style.display = "block";
	}
function chimagelanr()
	{
	document.getElementById('qands').style.background='url(images/qandans.jpg)';
	//document.getElementById('qands').style.background-repeat="no-repeat";
	document.getElementById('qandans').style.display = "none";
	document.getElementById('linksre').style.background='url(images/links_resorces_h.jpg)';
	document.getElementById('liandre').style.display = "block";
	}
function checkCity(){
	if(document.citySearch.uscity.value==""){
		alert("Please enter keyword");
		document.citySearch.uscity.focus()
		return false
	}
}


var imgDir = site_root_stripped+"/scripts/popcal_images/";

function visitSelectedCity(){
	var city_select = document.getElementById('city_select');
	if(typeof(city_select.value)=='string' && city_select.value){
		window.location.href = 'http://'+city_select.value;
	}
}

function get_state_cities(state_id){
	var url = site_root_stripped+'/ws/ads/index.php?op=area&what=get_state_cities&state_id='+state_id+'&output=jquery&callback=?';
	
	displayWaitMessage();
	
	jQuery.ajax({
		type: "GET",
		url: url,
		data: {},
		success: show_state_cities,
		dataType: 'json'
	});
}

function show_state_cities(data){
	var city_select = document.getElementById('city_select');
	city_select.innerHTML = '';
	if(typeof(data.cities)=='object'){
		for(i in data.cities){
			var temp_city = data.cities[i];
			var temp_option = document.createElement('option');
			temp_option.value = temp_city.domain;
			temp_option.innerHTML = temp_city.name;
			city_select.appendChild(temp_option);
		}
	}
	if(typeof(data.state_details)=='object'){
		var city_list_title = document.getElementById('city_list_title');
		city_list_title.innerHTML = data.state_details.name+' Cities';
	}
	hideWaitMessage();
}

function go_to_gwt_autocomplete_value(){
	try{
		city_autocomp = document.getElementById('city_autocomp');
		var delimiter = city_autocomp.value.indexOf(' - ');
		
		if(delimiter>0){
			var domain = city_autocomp.value.substr(delimiter+3);
			var my_regexp = new RegExp(/^([a-z0-9\-_]+\.)+[a-z0-9\-_]+$/i);
			var temp = domain.match(my_regexp);
			if(temp){
				var location = 'http://'+domain;
				window.location.href = location;
				return false;
			}
		}
	}
	catch(ERR){}
	
	setTimeout("go_to_gwt_autocomplete_value()", 100);
	return false;
}

/*function hack_gwt_filed(){
	city_autocomp = document.getElementById('city_autocomp');
	var old_onchange = city_autocomp.onchange;
	
	city_autocomp.onchange = function(){
		go_to_gwt_autocomplete_value();
		if(typeof(old_onchange)=='function'){
			old_onchange();
		}
	}
	
	var old_onchange = city_autocomp.onkeyup;
	city_autocomp.onkeyup = function(){
		go_to_gwt_autocomplete_value();
		if(typeof(old_onchange)=='function'){
			old_onchange();
		}
	}
}*/

var city_autocomp;


function Clickheretoprint(){ 
	var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
		 disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25"; 
	var content_vlue = document.getElementById("print_content").innerHTML; 

	var docprint=window.open("","",disp_setting); 
		docprint.document.open(); 
		docprint.document.write('<html><head><title>musixo.com.com</title>'); 
		//docprint.document.write('<table><tr><td>sdfdsf</td></tr></table>'); 
		docprint.document.write('</head><body onLoad="self.print()" bgcolor="#F6F9FF"><center>');          
		docprint.document.write('<table width="100%" border="0"><tr><td style="font-family:Arial, Helvetica,sans-serif;font-size:12px;color:#032372;text-decoration:none">')
		docprint.document.write(content_vlue);          
		docprint.document.write('</td></tr></table>')
		docprint.document.write('</center></body></html>'); 
		docprint.document.close(); 
		docprint.focus(); 
}
