
//--------------------------------------------------------------
function awButtonSubmit(id1, event)
{
    var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
    if (keyCode == 13 || keyCode == 3) 
    {
		event.returnValue=false;
		id1.returnValue=false;
	   	id1.click();
		if (document.all && document.getElementById)
		{
		}
	}
}  

//--------------------------------------------------------------
function awDualButtonSubmit(id1, id2, event)
{
    var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
    if (keyCode == 13 || keyCode == 3) 
    {
		event.returnValue=false;
		if (id1 != undefined)
		{
			id1.returnValue=false;
	   		id1.click();
	   	}
	   	else if (id2 != undefined)
	   	{
			id2.returnValue=false;
	   		id2.click();
	   	}
	}
}  

//--------------------------------------------------------------
function SetQSBox(Obj, Val)
{
    obj.value = Val;
}  


var isInput;

//--------------------------------------------------------------
function IsInputSubmit()
{
	if (isInput)
	{
		return true;
	}
	else
	{
		return false;
	}
}  

var isQSInput;

//--------------------------------------------------------------
function awQSClick(rootpath, Keywords, InitialValue)
{

	if (isQSInput)
	{
		isQSInput=true;
		if (Keywords.value == InitialValue)
		{
			document.location = rootpath + "/Default.aspx?sID=5";
		}
		else
		{
		isInput = true;
		}
	}
	else
	{
		return false;
	}
	
}  

//--------------------------------------------------------------
function awPopUpWindow(url, target, features) {
	//"location=0,  statusbar=0,  menubar=0,  width=800,  height=300";
  	var theWindow =
    window.open(url, target, features);
 	theWindow.focus();
  	return theWindow;
}

//--------------------------------------------------------------	
function awOpenMailWin(x, y, params) 
{
	if (params =="")
		window.open(x,y,'status=no,scrollbars=no,resizable=no,width=400,height=425');
	else
		window.open(x, y, params);
}


//--------------------------------------------------------------	
//Author: Brian Burke
//Function to overwrite an image with one from an array set up in the header.
function RandomImg(ImgId) 
{
		do 
		{								
			i=Math.floor(Math.random()*oIDArray.length); 
		}
			while(typeof(oIDArray[i])=="undefined");	
	//document.getElementById(ImgId).src= oIDArray[i];
	//document.getElementById(ImgId).alt= AltArray[i];
		document.write("<img src=" + oIDArray[i] + " alt='" + AltArray[i]> + "'");	
}

//--------------------------------------------------------------	
function randselect() 
{							
	do 
	{												
		i=Math.floor(Math.random()*Items.length); 
	}
	while(typeof(Items[i])=="undefined");	
	return i;								
}
//--------------------------------------------------------------
function awHomeRandomImage(ID, imgAlt, ImgID) 
{
	document.write("<img id='"+ ImgID +"' src='" + ID + "' alt='" + imgAlt + "' />");
}

function awRandomQuoteImageWithURL(Item, RootPath) 
{
	//Item is an array of field as follows
	// 0 = Id of Image
	// 1 = Image Alt Text
	// 2 = LanguageID
	// 3 = URL
//	if (Item[3] != "")
	//	document.write("<a href='" + Item[3] + "'>" + "<img src='" + RootPath + "/fileserver.aspx?oID=" + Item[0] + "&amp;lID=" + Item[2] + "' alt='" + Item[1] + "' title='' /></a>");
	//else
		document.write("<img src='https://www.solihullcommunityhousing.org.uk/fileserver.aspx?oID=" + Item[0] + "&amp;lID=" + Item[2] + "' alt='" + Item[1] + "' />");

}


//--------------------------------------------------

function popUpnew(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=825,height=520,left = 240,top = 62');");
}

