/*
general scripts
*/

var imagenumber = 7 ;
var randomnumber = Math.random() ;
//var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ;
//var rand2 = Math.round( (imagenumber-1) * randomnumber) + 1 ;


var rand1= Math.floor(Math.random() * imagenumber) + 1;
var rand2= Math.floor(Math.random() * imagenumber) + 1;

//make sure that second var if different from 1st var
//if (rand1 == rand2) {
	
//	if (rand1 != imagenumber) {
		
//		rand2 = rand1 + 1;
//	} else {
//		rand2 = 1; 
//	}
//}

while (rand1 == rand2){
	rand2= Math.floor(Math.random() * imagenumber) + 1;
}

//rand1 = 3 ;
images = new Array
images[1] = "./images/bham_sm.jpg"
images[2] = "./images/regus_sm.jpg"
images[3] = "./images/ubiq-use_sm.jpg"
images[4] = "./images/outdoorAds_sm.jpg"
images[5] = "./images/carPark5_sm.gif"
images[6] = "./images/girlmobile_sm.jpg"
images[7] = "./images/adstairs_sm.jpg"

var image1 = images[rand1]
var image2 = images[rand2]

links = new Array
links[1] = "outdooradvertising.html"
links[2] = ""
links[3] = "thruglass.html"
links[4] = "whyoutdoor.html"
links[5] = "carpark.html"
links[6] = "bluetooth.html"
links[7] = "digitalsignage.html"


var link1 = links[rand1]
var link2 = links[rand2]

main = new Array
main[1] = "BrownAbility to launch outdoor Digital Advertising and events channel in Birmingham ..."
main[2] = "BrownAbility to move to the hub of excitement in Brindley Place."
main[3] = "We provide high contrast dynamic display solutions for a wide range of sectors ..."
main[4] = "Why You Should Use Outdoor Advertising ..."
main[5] = "Car Park Owners; Generate new forms of revenue with NO investment from you."
main[6] = "In today's digitally connected society, research suggests around 90% of the ..."
main[7] = "Digital Signage refers to electronically controlled signs that can be updated ..."

var main1 = main[rand1]
var main2 = main[rand2]

text = new Array
text[1] = "Read More"
text[2] = ""
text[3] = "Read More"
text[4] = "Read More"
text[5] = "Read More"
text[6] = "Read More"
text[7] = "Read More"


var text1 = text[rand1]
var text2 = text[rand2]

more = new Array
more[1] = "./images/1_z1.gif"
more[2] = "./images/space.gif"
more[3] = "./images/1_z1.gif"
more[4] = "./images/1_z1.gif"
more[5] = "./images/1_z1.gif"
more[6] = "./images/1_z1.gif"
more[7] = "./images/1_z1.gif"

var more1 = more[rand1]
var more2 = more[rand2]


var foot1 ='BrownAbility Ltd. All rights RESERVED '
var foot2 = 'Registered in England and Wales 6016857'
var foot3 = 'VAT Registered 907 1300 63'


function ArticlePopup(newsArticleID){
	var Url;
	var name;
	var parameters;
	
	Url = "pages/articlepopup.jsp?newsArticleID="+ newsArticleID;
	name = "BuyPopup";
	parameters = "addressbar=no,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=450,height=500";
	open(Url, name, parameters);		
}

var popUpWin=0;

function popUpWindow(URLStr, left, top, width, height){
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function arch(src,w,h)
{
var wd = eval(" 'width="+w+",height="+h+", scrollbar=no, resizable=no, left=80, top=100' ");
window.open(src,'gal',wd)
}
