﻿


function checkSearchInput(theform)
{
  var valid = true;
  if (theform.SearchTerm.value == "") {
    valid = false;
	message = ("Please enter a search term\n");
	theform.SearchTerm.focus();
  }
  if (!valid) alert(message);

  if (valid) theform.submit();

  return valid;
}




function xxcheckSearchInput(form)
{
  var valid = true;
  
  if (form.SearchTerm.value == "") {
    valid = false;
	message = ("Please enter a search term\n");
	form.SearchTerm.focus();
  }

  if (!valid) alert(message);
  return valid;
}


function Quote(myFile, myWindowHandle){
	window.open(myFile, myWindowHandle,"scrollbars=yes,toolbar=no,resizable=yes,height=330,width=450")
}

function IndexHoldings(myFile, myWindowHandle){
	window.open(myFile, myWindowHandle,"scrollbars=yes,toolbar=no,resizable=yes,height=530,width=440")
}

function gotoExternalLinkDB()
{
    return(confirm("You are now leaving www.InvescoPowerShares.com and entering:\n\nhttp://www.PowerSharesETNs.com/\n\nTo return to Invesco PowerShares, simply close the second browser window.\n\n\This link is provided for informational purposes only and funds mentioned beyond this point are not distributed by Invesco Distributors, Inc., its affiliates or Invesco PowerShares Capital Management LLC.")); 
}


function gotoExternalLink()
{
    return(confirm("You are leaving the Invesco PowerShares website (Invescopowershares.com). This link is provided for informational purposes only and the web pages beyond this point are not maintained by Invesco Distributors, Inc., its affiliates or Invesco PowerShares Capital Management LLC.")); 
}

function showGlossary()
{
	window.open('/glossary.aspx', 'glossary',"statusbar=no,scrollbars=yes,toolbar=no,resizable=yes,height=380,width=680");

}


var isIE=document.all;
var isNN=!document.all&&document.getElementById;
var isN4=document.layers;

function distDiv(){
    if (isIE||isNN){       
        if (document.getElementById('distDisplay').style.visibility=="hidden"){
            document.getElementById('distDisplayLink').innerHTML="Hide Distributions"
            document.getElementById('distDisplay').style.visibility="";
            document.getElementById('distDisplay').style.display="";
        }
        else{        
            document.getElementById('distDisplayLink').innerHTML="View All Distributions"
            document.getElementById('distDisplay').style.visibility="hidden";
            document.getElementById('distDisplay').style.display="none";        
        }
    }       
    else if (isN4){
        
        if ((document.getElementById('distDisplay').style.visibility=="hide")||(document.getElementById('distDisplay').style.visibility=="hidden")){
            document.getElementById('distDisplayLink').innerHTML="Hide Distributions"
            document.getElementById('distDisplay').style.visibility="";
            document.getElementById('distDisplay').style.display="";
        }
        else{   
            document.getElementById('distDisplayLink').innerHTML="View All Distributions"     
            document.getElementById('distDisplay').style.visibility="hide";
            document.getElementById('distDisplay').style.display="none";        
        }            
    }
}


function LinkProspectus()
{
    if (this.window.opener == null) 
        location.href='/prospectus';
    else
    {
        this.window.opener.location.href='/prospectus';
        self.close();
    }
}

function LinkLegal()
{
    if (this.window.opener == null) 
        location.href='/legal.aspx';
    else
    {
        this.window.opener.location.href='/legal.aspx';
        self.close();
    }
}



function countryDiv(){
    if (isIE||isNN){       
        if (document.getElementById('countryDisplay').style.visibility=="hidden"){
            document.getElementById('countryDisplayLink').innerHTML="Hide Distributions"
            document.getElementById('countryDisplay').style.visibility="";
            document.getElementById('countryDisplay').style.display="";
        }
        else{        
            document.getElementById('countryDisplayLink').innerHTML="View All Distributions"
            document.getElementById('countryDisplay').style.visibility="hidden";
            document.getElementById('countryDisplay').style.display="none";        
        }
    }       
    else if (isN4){
        
        if ((document.getElementById('countryDisplay').style.visibility=="hide")||(document.getElementById('countryDisplay').style.visibility=="hidden")){
            document.getElementById('countryDisplayLink').innerHTML="Hide Distributions"
            document.getElementById('countryDisplay').style.visibility="";
            document.getElementById('countryDisplay').style.display="";
        }
        else{   
            document.getElementById('countryDisplayLink').innerHTML="View All Distributions"     
            document.getElementById('countryDisplay').style.visibility="hide";
            document.getElementById('countryDisplay').style.display="none";        
        }            
    }
}



