function addBookmark(articleTitle) {
	var title = document.title + ' ' + articleTitle;
	var url = document.location;
	if (window.sidebar){
		window.sidebar.addPanel(title, url,"");//Mozilla Firefox Bookmark
	} else if( window.external ){
		window.external.AddFavorite( url, title);//IE Favorite
	} else if(window.opera && window.print){
		return true;//Opera Hotlist
	}
}


function canResizeFlash(){
	var ua = navigator.userAgent.toLowerCase();
	var opera = ua.indexOf("opera");
	if( document.getElementById ){
		if(opera == -1) return true;
		else if(parseInt(ua.substr(opera+6, 1)) >= 7) return true;
	}
	return false;
}

function getWindowSize() {
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	return { width: myWidth , height: myHeight};
}

function notFound(){
	window.location = "404.html";
}

function openCustomWindow(URL,w,h, name){
	name = (name == undefined)? "Window" : name;	
	window.open(URL, name, "toolbar=no, location=no, status=yes, menubar=no,  resizable=no, scrollbars=no, width=" + w + ",height=" + h); 	
}

function parseQuery(){
	var pairHalves;
	var queryVars = {};
	var q_str = parseQuery.arguments[0];
	
	if(q_str == '') return;
	
	var N_V_pairs = q_str.split("&");
	var l = N_V_pairs.length;
	for(var i=0; i<l; i++){
		pairHalves = N_V_pairs[i].split("=");
		queryVars[pairHalves[0]] = unescape(pairHalves[1]);
	}
	return queryVars;
}

function setWidth(eid, newW, m){
	document.getElementById(eid).style.width = newW + m;
}

function setHeight(eid, newH, m){
	document.getElementById(eid).style.height = newH + m;
}

function setSize(eid, newW, newH){
	setWidth(eid, newW);
	setHeight(eid, newH);
}

function setScrollTop(){
	self.scrollTo(0,0);
}

function setScrollBottom(){
	self.scrollTo(0,3000);
}

function setScrollPos(numPos){
	//alert('setScrollPos ')
	self.scrollTo(0,numPos);
}

function getScrollPos(){
	
  var scrollX, scrollY;
  
  if (document.all)
  {
     if (!document.documentElement.scrollLeft)
        scrollX = document.body.scrollLeft;
     else
        scrollX = document.documentElement.scrollLeft;
           
     if (!document.documentElement.scrollTop)
        scrollY = document.body.scrollTop;
     else
        scrollY = document.documentElement.scrollTop;
  }   
  else
  {
     scrollX = window.pageXOffset;
     scrollY = window.pageYOffset;
  }
  //alert('getScrollPos scrollX: ' + scrollX + ' scrollY: ' + scrollY)
  return {x:scrollX,y:scrollY};
}

function pageScroll(x,y){
	document.scrollBy(x,y);	
}

function setFocus() {
	window.focus();
}

function setSwfFocus() {
	document.getElementById(swfId).focus();
}

function urlEncodeObject() {
	var obj = urlEncodeObject.arguments[0]
	var q_str = ''; 
	for (var key in obj) {
		q_str += key + '=' + escape(obj[key]) + '&';
	} 
	q_str = q_str.substr(0, q_str.length - 1);
	return q_str
}



