<!--

//Main.JS

function setAction(form, newAction)
{
	form.action = newAction;
	return;
}

function openCentered(theURL,winName,winWidth,winHeight,features) {
	var w = (screen.width - winWidth)/2;
	var h = (screen.height - winHeight)/2 - 30;
	features = features+',width='+winWidth+',height='+winHeight+',top='+h+',left='+w;
	exitstat = window.open(theURL,winName,features);
}

function hint(oID)
	{
		var x;
		x = document.getElementById(oID);
		if (x.style.visibility == 'visible')
		{
			x.style.visibility = 'hidden';
		}
		else
		{
			x.style.visibility = 'visible';
		}
		return;
}

//ajax general functions
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;  
}  
	
function XmlPost(QueryString, ResponsePage){  
	var xmlRequest = GetXmlHttpObject();
	xmlRequest.open("POST", ResponsePage, false);  
	xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=ISO-8859-1");
	xmlRequest.send(QueryString);
	return xmlRequest.responseText;
 }

function encode(uri){  
    if (encodeURIComponent){  
        return encodeURIComponent(uri);  
    }  
  
    if (escape){  
        return escape(uri);  
    }  
}  
//end ajax general functions

//show magazine cover on homepage from digital.domain.ca 
function showcover() {
	document.getElementById("cover").innerHTML = XmlPost("", "http://digital.albertafarmerexpress.ca/xta-asp/thumb.asp?pc=ae");	
	return;
}



// -->
