// JavaScript Document
function getInnerWidth() {
	if ( document.body.clientWidth != undefined ) {
		return document.body.clientWidth;
	} else {
		return window.innerWidth;
	}
}

function getInnerHeight(){
	if ( document.body.clientHeight != undefined ) {
		return document.body.clientHeight;
	} else {
		return window.innerHeight;
	}
}

function getPageXOffset(){
	if ( document.body.scrollLeft != undefined ) {
		return document.body.scrollTop;
	} else {
		return window.pageXOffset;
	}
}

function getPageYOffset(){
	var scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
	}
	return scrOfY;
}

function scrollYTo( yPos ) {
	window.scrollTo( 0, yPos );
	
	if ( document.body.scrollTop != undefined ) {
		document.body.scrollTop = yPos;
	} else {
		window.pageYOffset = yPos;
	} 
}

function popup( url, width, height )
{
	
	var top= ( screen.height / 2 ) - ( height / 2 );
	var left= ( screen.width / 2 ) - ( width / 2 );
	
	newwindow=window.open( url ,"", "scrollbars=yes", " + height=" + height + ",width=" + width + ", top=" + top + ", left=" + left );
	
	  if(!newwindow) 		  
            getSwf().openWindowFromSwf(url);
      else 
		  newwindow.focus();

}

function getSwf() {
	var id = "my_flash";
	if (navigator.appName.indexOf("Microsoft") != -1) 
		return window[id];
	else
		return document[id];
} 

function scrollIntoView( yPos ) {
	var offset = getPageYOffset();
	var winHeight = getInnerHeight();
	if ( yPos < offset + 50 ) {
		scrollYTo( yPos - 130 );
	} else if ( yPos > offset + winHeight - 80 ) {
		scrollYTo( yPos - winHeight + 200 );
	}
}

function email( email )
{
	var emailadd = 	"mailto:" + email;
	window.location.href = emailadd;
}



