//Vars
var timer = 0;
var openedMenu = null;
var req = null;
var newsMinimized = true;
var qlMinimized = true;
var newsBlockHeight= 0;
var qlBlockHeight= 0;


function printPage()
{
window.print()
//confirm('are u sure')
}
/*----------------------------------*/

function configure(){
	var obj = document.getElementById("newsBlock");
	newsBlockHeight = obj.style.height;
}

/*----------------------------------*/
function configureHome(){
	var obj = document.getElementById("newsBlock");
	var obj2 = document.getElementById("quickLinksBlock");
	newsBlockHeight = obj.style.height;
	qlBlockHeight = obj2.style.height;
}
/*----------------------------------*/

function expandQuickLinks(){
	var obj = document.getElementById("quickLinksBlock");
	var obj2 = document.getElementById("toggleButton_ql");
	if(qlMinimized){
	obj.style.height = 'auto';		
	qlMinimized = false;
	obj2.style.backgroundImage= "url(images/close_500.png)";
	}else{
	obj.style.height = "" + qlBlockHeight.toString(); 
	qlMinimized = true;
	obj2.style.backgroundImage= "url(images/open_500.png)";
	}
}
/*----------------------------------*/

function expandNews(){
	var obj = document.getElementById("newsBlock");
	var obj2 = document.getElementById("toggleButton_news");
	if(newsMinimized){
	obj.style.height = 'auto';		
	newsMinimized = false;
	obj2.style.backgroundImage= "url(images/close.jpg)";
	}else{
	obj.style.height = "" + newsBlockHeight.toString(); 
	newsMinimized	= true;
	obj2.style.backgroundImage= "url(images/open.jpg)";
	}
}

/*----------------------------------*/

function toggleMenu(arg1){
if(openedMenu != null){
//	
if(openedMenu == arg1){
closeMenu();
}
//
if(openedMenu != arg1){
closeMenu();
openMenu(arg1);
}
//
 }else{
openMenu(arg1);	
 }

}

/*----------------------------------*/
function openMenu(arg1){
var obj = document.getElementById("menu_"+arg1);
obj.style.display = 'block';
var obj1 = document.getElementById("href_"+arg1);
openedMenu = arg1;
}
/*----------------------------------*/
function closeMenu(){
var obj = document.getElementById("menu_"+openedMenu);
obj.style.display = 'none';
var obj1 = document.getElementById("href_"+openedMenu);
openedMenu = null;
}

/*----------------------------------*/
function photoGalleryGenerator(configFile){
var flashPhotoPlayer = new SWFObject("wsjMMPlayer.swf", "Photo Gallery Generator 1.0", "440px", "200px", "8", "#FFFFFF");
flashPhotoPlayer.addParam("quality", "high");
flashPhotoPlayer.addParam("wmode", "transparent");
flashPhotoPlayer.addParam("scale", "noscale");
//
flashPhotoPlayer.addVariable("title", "WSJ_photoGalleryGenerator");
flashPhotoPlayer.addVariable("configFile", configFile);
//
flashPhotoPlayer.write("flash");		

}
/*----------------------------------*/

function addPlayer(configFile){
var flashPhotoPlayer = new SWFObject("adPlayer.swf", "Photo Gallery Generator 1.0", "440px", "200px", "8", "#FFFFFF");
flashPhotoPlayer.addParam("quality", "high");
flashPhotoPlayer.addParam("wmode", "transparent");
flashPhotoPlayer.addParam("scale", "noscale");
//
flashPhotoPlayer.addVariable("title", "WSJ_photoGalleryGenerator");
flashPhotoPlayer.addVariable("configFile", configFile);
//
flashPhotoPlayer.write("flash");		

}

/*----------------------------------*/
function photoPlayer(arg1){
var flashPhotoPlayer = new SWFObject("photoPlayer.swf", "Photo Player Ver1.0", "440px", "300px", "8", "#FFFFFF");
flashPhotoPlayer.addParam("quality", "high");
flashPhotoPlayer.addParam("wmode", "transparent");
flashPhotoPlayer.addParam("scale", "noscale");
//
flashPhotoPlayer.addVariable("title", "WSJ TV");
flashPhotoPlayer.addVariable("xmlData", arg1);
flashPhotoPlayer.addVariable("css", "styleSheets/flash.css");
flashPhotoPlayer.addVariable("fullViewURL", "");
//
flashPhotoPlayer.write("flash");		

}
/*----------------------------------*/
function photoPlayer2(arg1){
var flashPhotoPlayer = new SWFObject("flash/photoPlayer2.swf", "Photo Player Ver1.0", "560px", "300px", "8", "#FFFFFF");
flashPhotoPlayer.addParam("quality", "high");
flashPhotoPlayer.addParam("wmode", "transparent");
flashPhotoPlayer.addParam("scale", "noscale");
//
flashPhotoPlayer.addVariable("_title", "WSJ TV");
flashPhotoPlayer.addVariable("xmlData", arg1);
flashPhotoPlayer.addVariable("css", "styleSheets/flash.css");
flashPhotoPlayer.addVariable("fullViewURL", "");
//
flashPhotoPlayer.write("flash");		

}

