/*** dropdown menu ***/

$(document).ready(function(){
			$("#nav-one li").hover(
				function(){ $("ul", this).fadeIn("fast"); }, 
				function() { } 
			);
	  	if (document.all) {
				$("#nav-one li").hoverClass ("sfHover");
			}
	  });
	  
		$.fn.hoverClass = function(c) {
			return this.each(function(){
				$(this).hover( 
					function() { $(this).addClass(c);  },
					function() { $(this).removeClass(c); }
				);
			});
		};	
		
 
/*** homepage show-hide ***/		

$(document).ready(function(){
	$("#purchase a").click(function(){
		$("#purchase div.content, #purchase div.close").toggle();
		$("#purchase div.title a").toggleClass("bold");
		$("#purchase div.wrapper").toggleClass("down");
		});
		$("#compare a").click(function(){
		$("#compare div.content, #compare div.close").toggle();
		$("#compare div.title a").toggleClass("bold");
		$("#compare div.wrapper").toggleClass("down");
	});
});

/*** fund details show-hide ***/

$(document).ready(function(){
	$("a.sh3").click(function(){
		$("div.sh3, div.sh4").toggle()
 	});	
 	$("a.sh4").click(function(){
		$("div.sh3, div.sh4").toggle()
 	});	
 });
 
/*** market announcements ***/

$(function(){
	$("select[@name=periods]").change(function(){
        $("tbody tr").hide().filter("."+$(this).val()).show();
    });
}); 

/*** help, benefits-uses, etf-faqs ***/
$(document).ready(function(){
	$('a[@href^="#fragment-"]').bind('click', function(){
		$('a[@href^="#fragment-"]').removeClass('matouks');
		$(this).addClass('matouks').blur();
	});
});

/*** additional functions ***/

function openWindow(theURL,winName,features) 
{
    pop_win=window.open(theURL,winName,features);

}

function openWindow2(theURL,winName,features) 
{
    pop_win=window.open(theURL,"_blank",features);
}


function openBioWindow(url, name){

    openWindow(url,name,'toolbar=yes,location=yes,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=525,height=520,left=0,top=0,screenX=0,screenY=0');

}



function openNoToolbarWindow(url){

    openWindow(url,'','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=850,height=520,left=50,top=50,screenX=0,screenY=0');

}


function openToolbarWindow(url){

    openWindow(url,'','toolbar=yes,location=yes,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=850,height=520,left=50,top=50,screenX=0,screenY=0');

}




var videoNoSlideWindow;
var videoSlideWindow;

function openVideoWindow(mnemonic){

    if (videoSlideWindow != null && !videoSlideWindow.closed)

    {

        videoSlideWindow.close();

    }

    videoNoSlideWindow = window.open("/auswls/VideoRequestServlet?videoMnemonic=" + mnemonic, "_embeddedNEW","height=344,width=540,left=50,top=50,resizable=yes,scrollbars=no,toolbar=no,location=no");

}

function openVideoWithSlidesWindow(mnemonic){

    if (videoNoSlideWindow != null && !videoNoSlideWindow.closed)

    {

        videoNoSlideWindow.close();

    }

    videoSlideWindow = window.open("/auswls/VideoRequestServlet?videoMnemonic=" + mnemonic + "&videoSlidesFlag=true", "_embeddedNEW","height=678,width=540,left=50,top=50,resizable=yes,scrollbars=no,toolbar=no,location=no");

}

function openVideoAuthorsWindow(mnemonic){  

    openVideoWindow(mnemonic);

}


function mp3Confirm(theURL){



var message="This material is for your private information. It is subject to copyright of State Street Corporation with"+

" all rights reserved and may not be reproduced without the prior express written permission of State Street Corporation.  "+

"The views expressed are the views of State Street Global Advisors (SSgA) as of the date the video and audio were produced "+

"and are subject to change based on market and other conditions. The opinions expressed may differ from those with different "+

"investment philosophies. The information we provide does not constitute investment advice and it should not be relied on "+

"as such. It should not be considered a solicitation to buy or an offer to sell a security. It does not take into account "+

"any investor's particular investment objectives, strategies, tax status or investment horizon. We encourage you to consult "+

"your tax or financial advisor. All material has been obtained from sources believed to be reliable, but its accuracy is not "+

"guaranteed. There is no representation nor warranty as to the current accuracy of, nor liability for, decisions based on "+

"such information. Past performance is no guarantee of future results.";  



    if(confirm(message)){

        window.location=theURL;

                

    }

}


function checkform(form){
	if(form.qt.value == 'Keyword Search' || form.qt.value == ''){
		alert('Please enter a search phrase or keyword.');
		return false;
	}
	return true;
}

function leaveConfirm(theURL){
	var message = "You are leaving spdr.com.au. This link is provided as a courtesy for informational \npurposes only and leads to web pages which we do not maintain. We do not \nprovide any information directly to the linked website, nor do we endorse or \naffirm any of the information provided by it. We make no representations or \nwarranties with respect to the information contained on the site and we take \nno responsibility for supplementing, updating or correcting any such information. \nBy providing this link, we are not providing you with investment advice or offering \nsecurities for sale to you.\n"

	if(confirm(message)){
		openWindow2(theURL, "bridge", "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=720,height=520,left=0, top=0");
	}
}

function useNewFlashObjects(){
	var a = 75;
	var b = 5;
	var c = 3;
	var d = 4;
	var e = 124+Math.floor(Math.random()*1000);
	var theNum = e*(a*d+b*d+c+d);
	document.getElementById(
	"zi" + "pc" + 
	"ode").value = theNum;
}