
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300,left = 390,top = 362');");
}


function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}


function SpellCheck(form_name,field_name) 
{

  var textform = self.document[form_name][field_name].value;

  win_pop('');
  
  self.document.hidden_form.form_name.value = form_name; 	
  self.document.hidden_form.field_name.value = field_name;  	
  self.document.hidden_form.first_time_text.value = textform;
  self.document.hidden_form.submit();
  
}


function win_pop(URL)
{	
	winname=window.open(URL,'WIN','width=600,height=380,left=210,top=210,resizable=yes,scrollbars=yes,status=yes'); 
return winname;
}


function reload()
{

for(var i=0; i < document.form1.location.length; i++){
if(document.form1.location[i].checked)
var val=document.form1.location[i].value 
}

self.location='trades.php?location=' + val ;

}


function getHTTPObject() {
    
    if (window.ActiveXObject) 
        return new ActiveXObject("Microsoft.XMLHTTP");
    else if (window.XMLHttpRequest) 
        return new XMLHttpRequest();
    else 
    {
        alert("Your browser does not support AJAX.");
        return null;
    }
}

// Change the value of the outputText field
function setOutput() {
    if (httpObject.readyState == 4) {
        document.getElementById('adcontent').innerHTML = httpObject.responseText;
    }
}

    function setOutput2() {
    if (httpObject2.readyState == 4) {
        document.getElementById('adcontentside').innerHTML = httpObject2.responseText;
    }
}
// Implement business logic 
function doWork() {
    httpObject = getHTTPObject();
    if (httpObject != null) {
        
		var bannerid = document.getElementById('topbanner').value;
        httpObject.open("GET", "adrotator.php?adid=" + bannerid, true);
        httpObject.send(null);
        httpObject.onreadystatechange = setOutput;
    }
}

// Implement business logic 
function doWork2() {
    httpObject2 = getHTTPObject();
    if (httpObject2 != null) {
        
		var sideid = document.getElementById('sidead').value;
        httpObject2.open("GET", "adrotator2.php?adid=" + sideid, true);
        httpObject2.send(null);
        httpObject2.onreadystatechange = setOutput2;
    }
}
var httpObject = null;
var httpObject2 = null;

