
var curtMenu;
var choices;
function parseVote(choices) {
// Determine which radio box has been selected and return the URL
	var re=new RegExp('\'','gi');
	var c=choices.toString().replace(re,"");
	re=new RegExp(' ','gi');
	c=c.replace(re,'');
	re=new RegExp('\\?','gi');
	c=c.replace(re,'');
	re=new RegExp('-','gi');
	c=c.replace(re,'');
	var choicesComp=c.split(",");
	
	for (i=0; i < choicesComp.length; i++) {
		var re=new RegExp('\'','gi');
		var c=choicesComp[i].replace(re,"");
		re=new RegExp(' ','gi');
		c=c.replace(re,'');
		if (document.getElementById(c).checked) {									return "&checked="+document.getElementById(c).value;
		}
	}
	
	return "";
}
function voteDisplay(choices,question) {
	var calcWidthPopup=200;
	var calcHeightPopup=200;
	var max=0;
	for (var i=0; i < choices.length; i++) {
		if (choices[i].length > max) {
			max=choices[i].length;
		}
	}
	
	if (question!="") {
		document.writeln("<br /><b>" + question+"</b></br />");
	} 
	for (var i=0; i < choices.length; i++) {
		var re=new RegExp('\'','gi');
		var c=choices[i].replace(re,"");
		re=new RegExp(' ','gi');
		c=c.replace(re,'');
		re=new RegExp('\\?','gi');
		c=c.replace(re,'');
		re=new RegExp('-','gi');
		c=c.replace(re,'');
		
		var ln="<br /><input class=\"inputVoteRadio\" id='"+c+"' type='radio' name=\"vote\" value='"+c+"' />"+choices[i];
		
		document.writeln(ln);
	}
	return choices;
}
function vote(voteName,choices,module) {
		var append="";	
		var pv=parseVote(choices); 
		if (checkCookie(voteName)==null) {		
			if (!pv) {
				alert('Please make a choice when voting!')} 
			else {
				var append='&id='+voteName+'&vote'+pv;
				var loc=document.location.href.toLowerCase();							 if(module == "quiz") {
				document.location.href='/use/www_use_allegheny.nsf/fm-Quiz?openform'+append;				}
				else {
				document.location.href='/use/www_use_allegheny.nsf/fm-Vote?openform'+append;
				}					
			}			
		}
}
function buildurl (query){
	var tmpURL = window.document.URL;
	var tmpLength = tmpURL.indexOf(".nsf");
	if (tmpLength > 0) {
		var fullURL = tmpURL.substring(0,(tmpLength+4));
	} else {
		var fullURL = "/use/www_use_allegheny.nsf"
	}
	if (query == "") {
		alert("Please enter something to search for");
	}
	else{
		url= "/use/www_use_allegheny.nsf/fm-search?openform&query="+query+"&start=1"
		var resultwin= window.open(url,"_self")
	}
}
function popup(filename,windowname,properties) {
	mywindow = window.open(filename,windowname,properties);
}
function checkEnterSearch(e,obj){ //e is event object passed from function invocation
	if(e && e.which){ //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	}
	else{
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}
	if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
		buildurl(obj.value);
		return true 
	}
		else{
		return false
	}
}
//************************************************
// getAnchorPosition(anchorname)
// This function returns an object having .x and .y properties which are the coordinates
// of the named anchor, relative to the page.
//************************************************
function getAnchorPosition(anchorname) {
	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (document.getElementById) { use_gebi=true; }
	else if (document.all) { use_css=true; }
	else if (document.layers) { use_layers=true; }
	// Logic to find position
 	if (use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_gebi) {
		var o=document.getElementById(anchorname);
		x=AnchorPosition_getPageOffsetLeft(o);
		y=AnchorPosition_getPageOffsetTop(o);
		}
 	else if (use_css) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_layers) {
		var found=0;
		for (var i=0; i<document.anchors.length; i++) {
			if (document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
		}
	else {
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
}
//************************************************
//* Functions for IE to get position of an object
//************************************************
function AnchorPosition_getPageOffsetLeft (el) {
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
}
function AnchorPosition_getWindowOffsetLeft (el) {
	return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
}	
function AnchorPosition_getPageOffsetTop (el) {
	// figure out which offset value to start with
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
}
function AnchorPosition_getWindowOffsetTop (el) {
	return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
}
function noenter() {
  return !(window.event && window.event.keyCode == 13);
}
function testEnter(e,obj){ //e is event object passed from function invocation
	if(e.keyCode==13){
			buildurl(obj.value);
	}
}
//************************************************
//* MM functions
//************************************************
function MM_jumpMenu(targ,selObj,restore){ //v3.0
	
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function currentMenu() {
	curtMenu = document.forms[0].MenuImage.value;
	if (document.images[curtMenu]) {
		parts = document.images[curtMenu].src.split(".jpg");
		document.images[curtMenu].src = parts[0] + '_selected.jpg?openelement';
	}else{
		currentMenuID = document.getElementById("currentMenuID").value;
		if(currentMenuID!="" && document.getElementById(currentMenuID)){
			document.getElementById(currentMenuID).className= "menu_selected"; 
		}
	}
	window.status = '';
}
if(window.event + "" == "undefined") event = null;
function HM_f_PopUp(){return false};
function HM_f_PopDown(){return false};
popUp = HM_f_PopUp;
popDown = HM_f_PopDown;
function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;if(a[0] == curtMenu) {return false;};for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() {
  var i,x,a=document.MM_sr;if(a[0] == curtMenu) {};for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
var MAXINPUTFIELDS=4;
var mX=0;
var mY=0;
var svg=new Object();
String.prototype.trim=function(){
     var
         r=/^\s+|\s+$/,
         a=this.split(/\n/g),
         i=a.length;
     while(i-->0)
         a[i]=a[i].replace(r,'');
     return a.join('\n');
}
function trim(value) {
   var temp = value;
   var obj = /^(\s*)([\W\w]*)(\b\s*$)/;
   if (obj.test(temp)) { temp = temp.replace(obj, '$2'); }
   var obj = /  /g;
   while (temp.match(obj)) { temp = temp.replace(obj, " "); }
   return temp;
}
function checkMail(fld)
{
	// Provides a field object 
	var x = fld.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)) {
		return true;
	} else {
		return false;
	}
}
function validate() {
	// Validates story input
	document.all.edit_area.value = document.frames[0].window.document.body.innerHTML;
	var msg="";
	var aryFld=new Array("name","email","storytitle","edit_area");
	var aryName=new Array("Name","Email Address", "Title", "Story Detail");
	var cnt=0;
	
	for (i=0; i < aryFld.length; i++) {
		if (document.getElementById(aryFld[i])) {
			if (document.getElementById(aryFld[i]).value =="") {
				cnt++;
				msg+="\n"+aryName[i];
			}	
		}
	}
	
	//document.story.submit();
	if (msg !="") {
		msg= "Please fill in the following required fields before submission: \n\n"+msg;
	}
	if (msg=="") { 
		// Check valid email address
		if (checkMail(document.getElementById("email"))) {
			// Valid email address
		} else {
			msg="The email address is invalid, please re-specify";
			
			return msg;
		}
	}
	return msg;
}
function acceptUpload(index) {
	// Refers to a specific file upload, validates and returns true or false
	// depending on whether a file has actually been added
	var oldindex=index;
	var fld="upload"+index;
	
	// Hide all other fields greater than this unless it is the last one
	
	
	try { 
	
	
	var content=document.getElementById(fld).value;
		
		if (content!="") {
			index++;	// Ensures that the current field is hidden too
		}
			
		if (index < MAXINPUTFIELDS) {
			for (i=1; i < index; i++) {
				var fldHide="uploadArea"+i;
				if (document.getElementById(fldHide)) {
					document.getElementById(fldHide).style.visibility="hidden";
				}
			}
		}
			
		if (content!="" && index <= MAXINPUTFIELDS) {
			
			// Unhide next one in the queue
			fldAppear="uploadArea"+oldindex;
			
			if (document.getElementById(fldAppear)) {	// Hide current complete field
					document.getElementById(fldAppear).style.visibility="hidden";
			}
			fldAppear="tick"+(oldindex);	
			if (document.getElementById(fldAppear)) {	// Hide green accept
					document.getElementById(fldAppear).style.visibility="hidden";
			} else {
				window.status="Cannot find "+fldAppear;
			}
			fldAppear="uploadArea"+(oldindex+1);	
			if (document.getElementById(fldAppear)) {	// Make next field visible
					//document.getElementById(fldAppear).style.visibility="visible";
					// Transfer content to Uploads
					document.getElementById("uploads").innerHTML=document.getElementById(fldAppear).innerHTML;
					
			}
			if (document.getElementById("attachDisp")) {
				if (oldindex >1) {document.getElementById("attachDisp").innerText=oldindex+ " uploads."} else {document.getElementById("attachDisp").innerText=oldindex+ " upload."}
				
			}
		} else {
			if (content=="") {
				content="Please supply a file path";
			}
		}
	} catch (error) {
		alert("Error uploading file: "+error);
	}
	return content ;	 
}
function printEvent(e) {
   if (navigator.appName == "Microsoft Internet Explorer"){
    mX = event.clientX;
    mY = event.clientY;
  }
  else {
    mX = e.pageX;
    mY = e.pageY;
  }
  alert("Click at x = " + mX + " and y = " + mY);
}
function dispMenu(e) {
  if (navigator.appName == "Microsoft Internet Explorer"){
    	mX = event.clientX;
    	mY = event.clientY;
  }
  else {
    mX = e.pageX;
    mY = e.pageY;
  }
  var menu=document.getElementById("statusmenu");
  if (menu) {
  	menu.style.visibility= menu.style.visibility=="hidden" ? "visible" : "hidden";
  	menu.style.posLeft=mX;
  	menu.style.posTop=mY;
  }
}
function publish() {
	// Publish document
	var find="?opendocument";
	var status="published";
	var loc=document.location.href.toLowerCase();
	var index=loc.indexOf(find);
	if (index !=-1) {
	
		loc=loc.substring(0,index+find.length)+"&"+status;
	} else {
		loc=loc+"&"+status;
	}
	document.location.href=loc;
}
function reject() {
	// Reject document
	var find="?opendocument";
	var status="rejected";
	var loc=document.location.href.toLowerCase();
	var index=loc.indexOf(find);
	if (index !=-1) {
		loc=loc.substring(0,index+find.length)+"&"+status;
	} else {
		loc=loc+"&"+status;
	}
	
	document.location.href=loc;
}
function submitStoryAdmin() {
	// Validates then submits the StoryAdmin form
	
	setKeyword(document.getElementById("keywordAdd"));
	var tur=document.getElementById("thankyouresponse");
	var hemail=document.getElementById("heritageEmail");
	
	if (tur ==null || hemail==null) {
			alert("One of the required fields is missing. Unable to submit this form");
	} else {
		document.forms[0].submit();
	}
}
function addAdminKeyword(selObj, addValue) {
	// For a given select object, appends the value if it does
	// not already exist
	var blFound=false;
	if (addValue!="") {
		if (selObj) {
			for (i=0; i < selObj.length; i++) {
		
					if (selObj.options[i].value.toLowerCase()==addValue.toLowerCase()) {
						i=selObj.length;blFound=true;
					}
			}
			if (!blFound) {
					option =new Option (addValue, addValue);
					selObj.options[selObj.length] = option;		
			}
		}
	}
	
}
function removeAdminKeyword(selObj) {
	
	if (selObj.selectedIndex==-1) {
		alert("Please select a keyword first");
	} else {
		for (i=0; i < selObj.length; i++) {
			if (selObj.options[i].selected==true) {
				selObj.options[i]=null;
			}
		}
		
	}
}	
function setKeyword(selObj) {
	// Select All
	
	for (i=0; i < selObj.length; i++) {
		selObj.options[i].selected=true;
	}
}
function logoff(obj, url) {
	// Implements logoff for a particular screen
	// obj is the document object, url is the url string
	
	url=url.toLowerCase();
	nsfindex=url.indexOf(".nsf");
	if (nsfindex != -1) {
	
		if (document.getElementById("ThisDB")) {
			var thisdb=document.getElementById("ThisDB").value;
			obj.location.href=url.substring(0,nsfindex+4)+"?logout&redirectto="+thisdb+"/(webstories)?openview%26restricttocategory=Published";			
		} else {
			alert("Unable to Logout at this time.");
		}
	}	
}	
function validatePassword(pword) {
	var re = /^\w*(?=\w*\d)(?=\w*[a-z])(?=\w*[A-Z])\w*$/
	if (!re.test(pword)) { return false } else {return true}
}
function validateZIP(code) {
	var valid = "0123456789-";
	var hyphencount = 0;
	if (code.length!=5 && code.length!=10) {
	//	alert("Please enter your 5 digit or 5 digit+4 zip code.");
		return false;
	}
	for (var i=0; i < code.length; i++) {
		temp = "" + code.substring(i, i+1);
		if (temp == "-") hyphencount++;
		if (valid.indexOf(temp) == "-1") {
		//	alert("Invalid characters in your zip code.  Please try again.");
			return false;
		}
		if ((hyphencount > 1) || ((code.length==10) && ""+code.charAt(5)!="-")) {
			//alert("The hyphen character should be used with a properly formatted 5 digit+four zip code, like '12345-6789'.   Please try again.");
			return false;
		}
	}
	return true;
}
function postCodeZipSearch(code, typ) {
	/**
		typ = 0 for postcode, 1 for zip
	*/
	var loc=document.location.href;
        
	var dbName="use/www_use_allegheny.nsf";
	var user="Anonymous";
	var append='';
	var pos=loc.indexOf(".nsf")+4;
 
	if (loc.indexOf("-txt") !=-1) {
			append='txt';
	}
	if (loc.indexOf("-stc") !=-1) {
			append='src';		
	}
	var prefix='';
	if (loc.indexOf(".nsf")!=-1) {
		prefix=loc.substring(0,pos);
	} else {
		prefix="/"+dbName;
		window.status=prefix;
	}
	
	
	switch (typ) {
		case 0:
			// Lets remove the spaces from this postcode
			code = code.replace(" ", "");
// and lets convert it to uppercase
				code = code.toUpperCase();
				if (checkForFirstTwoDigits(code)== true ){		
				code = code + "11AA";
document.location.href=prefix+"/fm-postcode-search"+append+"?openform&postcode="+code;	
				}
				if(checkForTown(code)==true) {
		document.location.href=prefix+"/fm-postcode-search"+append+"?openform&town="+code;
				} else {	
				
				
					if (checkForFirstFourDigits(code)==true) {			
code = code + "1AA"; document.location.href=prefix+"/fm-postcode-search"+append+"?openform&postcode="+code;
					} else if (validatePostcode(code)==true) {
document.location.href=prefix+"/fm-postcode-search"+append+"?openform&postcode="+code;
					} else {
 
					alert("Please enter a valid postal code");
					
				}
			}
			break;
		case 1:
			if(code==""){
				alert("Please enter your ZIP code or location");
			}else{
				window.location.href=prefix+"/fm-ndos?OpenForm&go=1&zip="+code;
			}
			break;
	}
	return;
}	
function validatePostcode(postcode) {
	// Lets ensure this postcode is BS 7666 valid (minus the spaces)
	var regex= new RegExp("(GIR 0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW])[0-9][ABD-HJLNP-UW-Z]{2})");	
			
	if (regex.test(postcode)){
	     return true;
	}else{
		return false;
	}
}
function checkForFirstFourDigits(postcode) {
if (postcode.length<=4) {
	var regex= new RegExp("(GIR 	0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW]))");	
		if (regex.test(postcode)){
		postcode = postcode + "1AA"
		document.getElementById('postcode').value = postcode;
	     	return true;
		}else{
		return false;
		}
	} 
}
function checkForFirstTwoDigits(postcode) {
if (postcode.length<=2) {
	var regex= new RegExp("(GIR 0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y])))");	
		if (regex.test(postcode)){
		postcode = postcode + "11AA"
		document.getElementById('postcode').value = postcode;
	   	 return true;
		}else{
		return false
		}
}
}
function checkForTown(postcode) {	
	var regex= /^[a-zA-Z]+$/
		if (regex.test(postcode)){
	     return true;
		}else{
		return false;
		}
	
}
function createCookie(name,value,days){
	if (days){
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name){
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++){
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
function checkCookie(id) {
	
	var path="";
	d=new Date();
	
	if (!document.getElementById("compath")) {
		if (document.forms[0].compath) {
			path=document.forms[0].compath.value;
		}
	
	} else {
		path=document.getElementById("compath").value;		
	}
	
	
	if (path=="") {
		return;
	}
	voteCookie=path+"voting/"+id; 
	
	window.status="Reading "+voteCookie+"....>";
	var ret=readCookie(voteCookie);
	
	if (ret !=null) {
		alert("Sorry, you have voted already !");
		return ret;
	} else {		
		createCookie(voteCookie,d,"999");
		return ret;
	};
}
function checkEnter(e){ //e is event object passed from function invocation
	if(e && e.which){ //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	}
	else{
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}
	if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
		document.forms[0].submit() //submit the form
		return false 
	}
		else{
		return true 
	}
} 
function checkEnterSearch(e,obj){ //e is event object passed from function invocation
	if(e && e.which){ //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	}
	else{
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}
	if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
		buildurl(obj.value);
		return true 
	}
		else{
		return false
	}
}
function checkEnterPostcode(e,obj){ //e is event object passed from function invocation
	if(e && e.which){ //if which property of event object is supported (NN4)
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	}
	else{
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}
	if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
		postCodeSearch();
		return true 
	}
		else{
		return false
	}
}
function sort(fldVal, sOrder) {
	//var newVal=fldVal.toString().split(",");
	//newVal=newVal.toString().split(";");
	
	fldVal=fldVal.toString();
	
	/**  Sorts a field list delimited by commas or semi-colons**/
	if (fldVal.toString().indexOf(",")!=-1) {		
		arRet=fldVal.split(",");
	} else {
		arRet=fldVal.split(";");
	}	
	
	if (sOrder=='D') {
		return arRet.sort(sortDes);
	} else {
		return arRet.sort(sortAsc);	
	}
	
}
function sortAsc(a,b)
{
	if (a < b) {return -1}
 else if (a > b) {return 1}
 else {return 0}
}
function sortDes(a,b)
{
	if (b < a) {return -1}
 else if (b > a) {return 1}
 else {return 0}
}
function addToList(objW, objH, dwNm, dwVal, dhNm, dhVal, doWidth, doHeight) {	
	// Don't go past the boundaries
	// ty = 0 for increase, 1 for decrease
	var maxh=parseInt(document.all.setupimgMaxHeight.value);
	var maxw=parseInt(document.all.setupimgMaxWidth.value);
	var minh=parseInt(document.all.setupimgMinHeight.value);
	var minw=parseInt(document.all.setupimgMinWidth.value);
	
	
	var blFound=false;
	
	if (doWidth==true) {
		var len = objW.length++; // Increase the size of list and return the size
		for (i=0; i < len; i++) {
			if (objW.options[i].value==dwVal || objW.options[i].value==dwNm && dwVal!='') {
				blFound=true;
			}
		}
	}
	if (blFound==false && doWidth==true) {
		if ((dwVal+"").trim()!='' && (dwNm+"").trim() !='') {		
		     objW.options[len].value = dwVal;
			objW.options[len].text = dwNm;
		     objW.selectedIndex = len; 		
		}
     }     
     
     if (doHeight==true) {
       	len = objH.length++; // Increase the size of list and return the size
	    	blFound=false;
		for (i=0; i < len; i++) {
			if (objH.options[i].value==dhVal || objH.options[i].value==dhNm && (dhVal+"").trim()!='') {
				blFound=true;
			}
		}
		if (blFound==false) {
			if ((dhVal+"").trim()!='' && (dhNm+"").trim() !='') {
			     objH.options[len].value = dhVal;
				objH.options[len].text = dhNm;
			     objH.selectedIndex = len; 
			    }
		}
     }
}
function printFlashObj(file,w,h){
	document.write('<object type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"  data="'+file+'" width="'+w+'" height="'+h+'">');
	document.write('<param name="movie" value="'+file+'" />');
	document.write('<param name="quality" value="high" />');
	document.write('<embed src="'+file+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'" />');
	document.write('</object>');
}
