// JavaScript Document

function bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
	window.sidebar.addPanel(title,url,"");
  } else {
	alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}

function setHomepage(page) 
{ 
	if (document.all) 
	{ 
		document.body.style.behavior='url(#default#homepage)'; 
		document.body.setHomePage(page); 
		
		} 
		else if (window.sidebar) 
		{ 
			if(window.netscape) 
			{ 
				try 
				{ 
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
				} 
				catch(e) 
				{ 
				alert("this action was aviod by your browser if you want to enable，please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true"); 
			} 
		} 
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch); 
		prefs.setCharPref('browser.startup.homepage',page); 
	} 
} 


function showvideo(id,divshow,file,autoplay,total) {
	var width=440;
	var height=280;
	
	var s1 = new SWFObject("flvplayer.swf","single",width,height,"7");
	s1.addParam("allowfullscreen","true");
	s1.addParam("wmode","transparent");
	
	s1.addVariable('autostart',autoplay); 
	s1.addVariable("file","upload/video/"+file);
	s1.addVariable("image","");
	s1.addVariable("repeat","true");
	s1.addVariable("width",width);
	s1.addVariable("height",height);
	
	s1.write(divshow);
	
	for(i=0;i<total;i++)
		document.getElementById('video_'+i).className='black12';
	if(id)
		document.getElementById(id).className='red12';
	
}

