
// browser detection
var ua = navigator.userAgent.toLowerCase();
var is_pc_ie  = ( (ua.indexOf('msie') != -1 ) && ( ua.indexOf('win') != -1 ) && ( ua.indexOf('opera') == -1 ) && ( ua.indexOf('webtv') == -1 ) );
var is_ff =( (ua.indexOf('gecko') != -1 ) && ( ua.indexOf('opera') == -1 ) && ( ua.indexOf('safari') == -1 ));
var is_opera=(ua.indexOf('opera') != -1);

var gParams="";
var flashMovie;


// get our flash movie object
function init()
{
	if (document.getElementById) flashMovie = document.getElementById(flashID);
}

function updateFlashMovie(args)
{
	if (flashMovie)
	{
		window.document.location.hash=args;
		flashMovie.updateState(args);
	}
}

// function for parsing state string to an object
function getParams(){
	var o = new Object();
	var stateStr="";
	var urlStr = window.document.location.search.substr(1);
	var hashStr = window.document.location.href.split("#")[1];
	if (urlStr!=null && urlStr.indexOf(pageParameterName+"=")>=0) stateStr=urlStr;
	else if (hashStr!=null && hashStr.indexOf(pageParameterName+"=")>=0) stateStr=hashStr;
	var states = stateStr.split("&");
	var len = states.length;
	for (var i=0; i<len; i++) {
		var p = states[i].split("=");
		o[p[0]] = p[1];
	}
	return o;
}
function getParam(paramName)
{
	 var params=getParams();
 	if (params[paramName]!=null) return params[paramName];
 	else return "";
}
function getState(title) {
	var params = window.document.location.hash.split("#")[1];
	if(gParams!=params){
		gParams=params;
		//window.document.title = title+params.split(pageParameterName+'=')[1];
		window.document.title = title;
		return params;
	}
}
// non IE browser use this javascript to update hash and title
function putHref(stateStr, title) {
	var str=new String(stateStr);
	str=str.replace(/,/g, "&");
	window.document.location.hash=str;
	window.document.title = title;
}
function getURL() { 
      var url=window.location.href; 
      url=url.split('#');
      window.location.href=url[0];
      if(!is_pc_ie){
      	window.location.reload(true);
      }
 }
