//=============================================================================================
//    JS FUNCTIONS
//=============================================================================================


//fct - Open link in new window
function fctOpenUrl(strPageUrl) {
	//check if any content
	if (strPageUrl.length < 3){
		return false;
	}
	
	//check if exist "http://" in string
	if((strPageUrl.indexOf("://")) > -1){
		//ok
	}
	else{
		strPageUrl = "http://" + strPageUrl;
	}

	//open new window
	if (strPageUrl != ""){
		//vars
		var intTopY = 0;
		var intLeftX = 0;
		var intWidth = 400;
		var intHeight = 10;
		var intScreenWidth = 1024;	// default sizes
		var intScreenHeight = 768;	// default sizes
		var intSmaller = 10;
		var xWin;

		//get screensize
		if (window.screen) {
			intScreenWidth = window.screen.availWidth;		//(window.screen.availHeight)
		}

		//get screenheight
		if (window.screen) {
			intScreenHeight = window.screen.availHeight;		//(window.screen.availHeight)
		}
		
		//set left as center screen
		intWidth	= intScreenWidth;
		intHeight	= intScreenHeight;

		//change to smaller
		intTopY		= intSmaller;
		intLeftX	= intSmaller;
		intWidth	= intWidth - 2 * intSmaller;
		intHeight	= intHeight - 2 * intSmaller;

		//open window
		xWin = window.open(strPageUrl, '', 'height=' + intHeight + ', width=' + intWidth + ', top=' + intTopY + ', left=' + intLeftX + ',scrollbars=1, resizable=1, location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes');
		xWin.focus();
	}
}
//_____________________________________________________________________________________________


//fct - Open popup window
function fctPopupWindow(strPageUrl, intWidth, intHeight) {
	//check if any content
	if (strPageUrl.length < 3){
		return false;
	}
	
	//check if exist "http://" in string
	if((strPageUrl.indexOf("://")) > -1){
		//ok
	}
	else{
		strPageUrl = "http://" + strPageUrl;
	}

	//open new window
	if (strPageUrl != ""){
		//vars
		var intTopY = 0;
		var intLeftX = 0;
		var intScreenWidth = 1024;	// default sizes
		var intScreenHeight = 768;	// default sizes
		var xWin;

		//get screensize
		if (window.screen) {
			intScreenWidth = window.screen.availWidth;		//(window.screen.availHeight)
		}

		//get screenheight
		if (window.screen) {
			intScreenHeight = window.screen.availHeight;		//(window.screen.availHeight)
		}

		//change to smaller
		intTopY		= parseInt((intScreenHeight-intHeight)/2,10);
		intLeftX	= parseInt((intScreenWidth-intWidth)/2,10);

		//open window
		xWin = window.open(strPageUrl, 'xppopup', 'height=' + intHeight + ', width=' + intWidth + ', top=' + intTopY + ', left=' + intLeftX + ',scrollbars=1, resizable=1, location=no,directories=no,status=no,menubar=no,toolbar=no');
		xWin.focus();
	}
}
//_____________________________________________________________________________________________