function flashfix () {
	theObjects = document.getElementsByTagName("object");
		for (var i = 0; i < theObjects.length; i++) {
			theObjects[i].parentNode.innerHTML = theObjects[i].parentNode.innerHTML;
		}
} 

if (window.attachEvent){
	window.attachEvent("onload", flashfix);
}
window.onload=fixsafari;

function fixsafari(){
	//bookmark setup
	if(document.getElementById('bookmark')){
		if (window.external) {
		 	document.getElementById('bookmark').innerHTML='<a href = "javascript:bookmark()");">bookmark page</a>'; 
		  } else  if (window.sidebar) {
		  	document.getElementById('bookmark').innerHTML='<a href ="javascript:bookmark()");">bookmark page</a>'; 
		 } else if (window.opera && window.print) {	
		 	document.getElementById('bookmark').innerHTML='<a href = "javascript:bookmark()");">bookmark page</a>';
		 }else{
		 	document.getElementById('bookmark').innerHTML='<a href ="#">ctrl+d to bookmark page</a>';
		 }
	}	
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("safari") != -1){ 
		theObjects = document.getElementsByTagName("object");
		for (var i = 0; i < theObjects.length; i++) {
			if(theObjects[i].className == "duoflash"){	
				for (j=0;j<theObjects[i].childNodes.length;j++){
					if(theObjects[i].childNodes[j].name=="Src"){
						var data=theObjects[i].childNodes[j].value;
					}
				}
			var height=theObjects[i].height;
			var width=theObjects[i].width;
			var classid=theObjects[i].classid;
			var codebase=theObjects[i].codebase;
			var htmlData = theObjects[i].parentNode.innerHTML;
			var newHtml='<object class="duoflash" data="'+data+'" width="'+width+'" height="'+height+'" classid="'+classid+'" codebase="'+codebase+'" >  <param name="WMode" value="Opaque" /></object>';
			var newObject=theObjects[i].parentNode;
			newObject.innerHTML=newHtml;
			}
		}
	}
	flashfix();
}

function bookmark(){
	 
	 url = window.location;
		if (window.sidebar) { // Mozilla Firefox Bookmark
			window.sidebar.addPanel(title, url,"");
		} else if( window.external ) { // IE Favorite
			window.external.AddFavorite( url, title); 
		}else if(window.opera && window.print) { // Opera Hotlist
			return true; 
		}

}




function mailThisUrl() {
	var initialsubj="I thought you may find this interesting";
	var initialmsg="I saw this and thought you may find it interesting: "+window.location	
	window.location = "mailto:?subject="+initialsubj+"&body="+initialmsg
}




