function findPos(obj) {
	var pos = new Array();
	if (obj.offsetParent) {
		pos[0] = obj.offsetLeft;
		pos[1] = obj.offsetTop;
		while (obj = obj.offsetParent) {
			pos[0] += obj.offsetLeft;
			pos[1] += obj.offsetTop;
		}
	}
	return pos;
}
function GetXmlHttpOBJ(){ 
	var objXMLHttp=null;
	if (window.XMLHttpRequest) objXMLHttp=new XMLHttpRequest();
	else if (window.ActiveXObject)	objXMLHttp=new ActiveXObject('Microsoft.XMLHTTP');
	return objXMLHttp;
}
function setCookie(name,value,expires,path){
	var today = new Date();
	today.setTime( today.getTime());
	if ( expires )	expires = expires * 1000 * 60 * 60 * 24;
	var expires_date = new Date( today.getTime() + (expires) );
	document.cookie = name+'='+escape( value ) + ( ( expires ) ? ';expires='+expires_date.toGMTString() : '' ) + ( ( path ) ? ';path=' + path : '' );
}
function getCookie(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 deleteCookie(name) {
	setCookie(name,"",-1);
}
function ElmWidth(obj){
	if(obj.clientWidth) return obj.clientWidth;
	else return obj.offsetWidth;
}
function ElmHeight(obj){
	if(obj.clientHeight) return obj.clientHeight;
	else return obj.offsetHeight;
}
function setOpacity(Obj,opacity) {
	Obj.style.opacity = (opacity / 100);
	Obj.style.MozOpacity = (opacity / 100);
	Obj.style.KhtmlOpacity = (opacity / 100);
	Obj.style.filter = "alpha(opacity=" + opacity + ")";
}
function getavailHeight() {
  if( typeof( window.innerHeight ) == 'number' )	var y = window.innerHeight;
  else if( document.documentElement && document.documentElement.clientHeight) var y = document.documentElement.clientHeight;
  return y;
}
function getavailWidth() {
  if( typeof( window.innerWidth ) == 'number' )	var x = window.innerWidth;
  else if( document.documentElement && document.documentElement.clientWidth) var x = document.documentElement.clientWidth;
  return x;
}
function getscrollTop(){
   var h = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;          
   return h ? h : 0;
}
function getscrollLeft(){
   var l = window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;          
   return l ? l : 0;
}
var mposx = 0;
var mposy = 0;
function mpos(e){
	if(!e) var e = window.event;
	if(e.pageX || e.pageY){
		mposx = e.pageX;
		mposy = e.pageY;
	}else if(e.clientX || e.clientY){
		mposx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
		mposy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
	}
}
function selectedText(){
	if (document.getSelection)	var str = document.getSelection();
	else if (document.selection && document.selection.createRange)	var str = document.selection.createRange().text;
	return str;
}
function trim(str){ 
	while (str.substring(0,1) == ' '){ 
		str = str.substring(1, str.length); 
	} 
	while (str.substring(str.length-1, str.length) == ' '){ 
		str = str.substring(0,str.length-1); 
	} 
	return str; 
}
function popup(obj, w, h){
	var pop_win = window.open(obj.href,'pop_win','width='+w+', height='+h+', scrollbars=yes');
	pop_win.focus();
	return false;
}
function pop(url, w, h){
	var pop_win = window.open(url,'pop_win','width='+w+', height='+h+', scrollbars=yes');
	pop_win.focus();
	return false;
}
function openflash(src,width,height){ 
    var text="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width="+width+" height="+height+"><param name=movie value="+src+"><param name=quality value=high ><param name=wmode value=transparent><param name=menu value=false><embed src="+src+" quality=high  pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width="+width+" height="+height+"  wmode=transparent menu=false></embed></object>"; 
	document.write(text); 
}
function updateplayer(){
	if(confirm("You need to update your Flash Player. Do you want to update your Flash Player?")){
		location.href = "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
	}
}
