// JavaScript Document

function popupform(myform, windowname)
	{
	if (! window.focus)return true;
	window.open('', windowname, 'height=200,width=500,scrollbars=yes');
	myform.target=windowname;
	return true;
	}
	
	function popupwindow(myform, windowname, zheight, zwidth, zscrollbars)
	{
	if (! window.focus)return true;
	var winl = (screen.width-zwidth)/2;
    var wint = (screen.height-zheight)/2;
	window.open('', windowname, 'height=' + zheight + ',width=' + zwidth + ',scrollbars=' + zscrollbars + ',top=' + wint + ',left=' + winl);
	myform.target=windowname;
	return true;
	}
	
	function popupwindow(myform, windowname, zheight, zwidth, zscrollbars,zlocation)
	{
	if (! window.focus)return true;
	var winl = (screen.width-zwidth)/2;
    var wint = (screen.height-zheight)/2;
	window.open('', windowname, 'height=' + zheight + ',width=' + zwidth + ',scrollbars=' + zscrollbars + ',top=' + wint + ',left=' + winl+ ',location=' + zlocation);
	myform.target=windowname;
	return true;
	}



function addbookmark()
{
 pageTitle = document.title;
 pageUrl = document.location;
 if (window.sidebar) {
 window.sidebar.addPanel(pageTitle, pageUrl,"");
 } else if( document.all ) {
 window.external.AddFavorite( pageUrl, pageTitle);
 } else if( window.opera && window.print ) {
 return true;
 }
}

function popupShareThisPage(myform, windowname, zheight, zwidth, zscrollbars, PageURL, PageRef)
	{
	var winl = (screen.width-zwidth)/2;
    var wint = (screen.height-zheight)/2;
	window.open(PageURL + "?ref="+PageRef, windowname, 'height=' + zheight + ',width=' + zwidth + ',scrollbars=' + zscrollbars + ',top=' + wint + ',left=' + winl);
	}

// Get Url Parameters  
function gup( name )
{  
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  
	var regexS = "[\\?&]"+name+"=([^&#]*)";  
	var regex = new RegExp( regexS );  
	var results = regex.exec( window.location.href );  
	if( results == null )    
	return "";  
	else    
	return results[1];
	}