var xmlSource=["../xml/our-work-coolest-stuff.xml","../xml/our-work-online-advertising.xml","../xml/our-work-digital-media.xml"];



function changeFlash(file,classType,classIndustry){

	window.document.board.SetVariable("xmlFile", xmlSource[file]);

	if(classType)

		window.document.board.SetVariable("xmlClassA", classType);

	if(classIndustry)

		window.document.board.SetVariable("xmlClassB", classIndustry);

}


function setSelection(formname,selname,value){

	var thisSel=eval("document.forms."+formname+"."+selname);

	for(var i=0;i<thisSel.length;i++){

		if(thisSel.options[i].text==value)

			thisSel.options[i].selected=true;

	}

}


function setToDemoField(){

	if(document.location.search){

		var searchParams=document.location.search.toString().replace("?","").replace(/%20/g," ");

		var paramArray=searchParams.split("+");

		if(paramArray.length>0){

			var category=formName=selFormat=selIndustry="";

			switch(paramArray[0].toLowerCase()){

				case "coolest stuff": category=0; break;

				case "online advertising": category=1; formName="OnlineAdvertisingForm"; selFormat="OnlineAdFormatType"; selIndustry="OnlineIndustryType"; break;

				case "digital media": category=2; formName="RichApplicationsForm"; selFormat="RichAdFormatType"; selIndustry="RichIndustryType"; break;

			}

			if(category!=""){

				if(paramArray.length==1)

					changeFlash(category,"X","X");

				else if(paramArray.length==2){

					setSelection(formName,selFormat,paramArray[1]);

					changeFlash(category,paramArray[1],"X");

				}

				else if(paramArray.length==3){

					setSelection(formName,selFormat,paramArray[1]);

					setSelection(formName,selIndustry,paramArray[2]);

					changeFlash(category,paramArray[1],paramArray[2]);

				}

			}

		}

	}

}


function popUp(url,name,width,height){

	newwindow=window.open(url,name,"height="+height+",width="+width+",scrollbars=yes");

	if(window.focus)

		newwindow.focus();

}