﻿
function doLoadPage(xPage)
{
    //alert(xPage)
    closeIss();
    if (xPage == "Bio")
    {
        var elem, elem2,elem3;
        elem = document.getElementById("divHome");
        elem.style.display = "none";     
        elem3 = document.getElementById("divPhotos");
        elem3.style.display = "none";         
        elem2 = document.getElementById("divBio");
        elem2.style.display = "block";       
    }    
    else if (xPage == "Home")
    {
        var elem, elem2, elem3;
        elem = document.getElementById("divBio");
        elem.style.display = "none";
        elem3 = document.getElementById("divPhotos");
        elem3.style.display = "none";        
        elem2 = document.getElementById("divHome");
        elem2.style.display = "block";        
    }
  
    else if (xPage == "Photos")
    {
        var elem, elem2, elem3;
        elem = document.getElementById("divHome");
        elem.style.display = "none";
        elem2 = document.getElementById("divBio");
        elem2.style.display = "none";      
        elem3 = document.getElementById("divPhotos");
        elem3.style.display = "block";                  
    }     
}

function opnWin(xWin)
{
    if (xWin == "contr")
        window.open("https://www.campaigncontribution.com/donors_info.asp?id=B58B81B0%2D5EED%2D490F%2D925F%2D4EBB68F49FCF&db=6", "Contribute","status=0, toolbar=0, height=750, width=870, scrollbars=1, location=0, resizable=0, menubar=0");
    if (xWin == "twitter")
        window.open("http://twitter.com/mercerforsenate", "twitter","status=1, toolbar=1, height=750, width=870, scrollbars=1, location=1, resizable=1, menubar=1");   
    if (xWin == "fb")
        window.open("http://www.facebook.com/pages/Skip-Mercer-for-Senate-2010/272322174548?ref=ts", "facebook","status=1, toolbar=1, height=750, width=870, scrollbars=1, location=1, resizable=1, menubar=1");               
        
}

function doSelIss(xval)
{
    alert(xval);
    var sl = document.getElementById("ddIssues");
    sl.selectedIndex = 0;
}

function findPosition( oElement ) 
{
  if( typeof( oElement.offsetParent ) != 'undefined' ) {
    for( var posX = 0, posY = 0; oElement; oElement = oElement.offsetParent ) {
      posX += oElement.offsetLeft;
      posY += oElement.offsetTop;
    }
    return [ posX, posY ];
  } else {
    return [ oElement.x, oElement.y ];
  }
}

function findElem()
{
    //alert("oElem2");
    var oElem2 = document.getElementById("imgBio");
    var elm = findPosition(oElem2);
    fPos(elm);
}

function fPos(oElem)
{
    var x = oElem.slice(0,1);
    alert("x is" + x);
    var y = oElem.slice(1);
    alert("y is " + y);
}

function showUT()
{
    closeIss();
    var w = document.getElementById("divUtube");
    w.style.display = "block";
}

function showIss(xItm)
{
    //alert(xItm);
    closeIss();
    var w1 = document.getElementById("imgBio");
    var elm = findPosition(w1);
    var xLeft = elm.slice(0,1); 
    //alert(xLeft);      
    var xTop = elm.slice(1);
    //alert(xTop);
    
    //findPosition(w1).join(;
    //findPosition(this)).join
    //


    var w = document.getElementById("divIss");
    //w.style.left = xLeft;
    //w.style.top = xTop;// + 30;

    if (xItm == 1)
    {
        
        var wCont = document.getElementById("divIssCnt");//Economy
     
        wCont.innerHTML = "The success of our country and the State of Washington has been based upon a free economy.  History, both distant and recent, should help us understand this.  Our economy is the fabric that ties our security, standard of living, peace-of-mind, family goals, and our children’s future all together.  Today our national debt exceeds ten trillion dollars and the unemployment in Washington State is near the national average of ten percent.  Given our high-tech industry base and our access to the Asian markets we should be doing much better than the national average.  Unfortunately, our representatives have been voting a party line and not looking out for us.  Where was the leadership from Washington State when Boeing decided to build a new plant elsewhere?  I will work to:"+
                      "<br />"+
                      "<ol>"+
                      "  <li>Reduce government spending in non-essential areas.</li>"+
                      "  <li>Reduce taxation which is the best way to stimulate our economy.  (Please"+          
                      "       note that the current stimulus package has only stimulated Wall Street"+ 
                      "       and the large financial institutions.)</li>"+ 
                      "  <li>Gain energy independence from foreign nations.</li>"+
                      "  <li> Simplify the existing tax code and reduce the non-productive tax industry.</li>"+
                      "  <li>Dramatically improve our cost prohibitive health care system without"+ 
                      "       relying on a government take over.</li>"+
                      "  <li>Eliminate unnecessary government bureaucrats and regulations.</li>"+
                      "  </ol>";
         w.style.display = "block";           
    }
    else if (xItm == 2)//Education
    {
        var wCont = document.getElementById("divIssCnt");
     
        wCont.innerHTML = "We all realize that in the long-run our national defense and our economy depend upon a citizenry that is well educated and equipped to compete in the global marketplace.  As an academic I am constantly disappointed at the preparation US students, and particularly students from Washington State, have received prior to arriving at the University of Washington.  I will work to:"+
                      "<br />"+
                      "<ol>"+
                      "<li>Direct federal dollars to successful K-12 education programs in our state in order to foster competition between them, and stop rewarding the non-performers in   education.</li>"+
                      "  <li>Support charter schools and home schooling.</li>"+
                      "  <li>Improve education of parents regarding their participation in the process.</li>"+
                      "  <li>Support higher teacher salaries for those who have earned it.</li>"+
                      "  </ol>";
        w.style.display = "block";              
    }
    else if (xItm == 3) //Frivolous Lawsuits
    {
        var wCont = document.getElementById("divIssCnt");
     
        wCont.innerHTML = "Frivolous lawsuits threaten health care costs, small and large businesses, consumers of insurance, and cost taxpayers millions of dollars annually.  Seventy-Five percent of the voters in Washington State believe that tort law is out of control and that the awards for frivolous lawsuits are hurting our economy.  I will work to:"+
                          "<br />"+
                        "<ol>"+ 
                        "<li>Pass liability reform legislation that will protect the citizens of Washington State and the rest of our country.</li>"+
                        "<li>Put a cap on awards that are not intended for economic recovery.</li>"+
                        "<li>Limit the percentage of the awards that go to the trial lawyers so that the victims get a fair outcome.</li>"+
                        "</ol>";                                
        w.style.display = "block";
    } 
    else if (xItm == 4) //Credit Card Companies
    {
        var wCont = document.getElementById("divIssCnt");
     
        wCont.innerHTML = "Credit card companies are beginning to threaten American families with unfair and scrupulous practices.  It is true that the amount of credit owed by US citizens has increased tremendously, but the credit card companies are trying to erase the effects of their own overly competitive practices by punishing those who play by the rules.  Some companies are beginning to charge fees to those who pay off their entire bill at the end of every month.  And for those who are working on paying off their debt, the interest rates are beginning to skyrocket.  I will work to:"+                                 
                         "<br />"+
                        "<ol>"+ 
                        "<li>Introduce regulations that limit the ability of credit card companies to charge fees on existing accounts when those accounts are paid off every month.</li>"+
                        "<li>Guarantee that the interest charged on unpaid balances cannot increase retroactively on that amount, but only on balances created after an interest rate increase.</li>"+ 
                        "</ol>";                                
        w.style.display = "block";
    } 
    else if (xItm == 5) //Federal Income Tax
    {
        var wCont = document.getElementById("divIssCnt");
     
        wCont.innerHTML = "The current federal tax code contains tens of thousands of pages and represents a government that is not for the people.  The code needs to be greatly simplified and made to be fair to all Americans.  Even the Form 1040 is almost 200 pages.  There are several obvious steps.  I will work to:"+
                          "<br />"+
                        "<ol>"+ 
                        "<li>Simplify the tax code while eliminating loopholes for those that unfairly avoid taxes.</li>"+
                        "<li>Repeal the “death tax.”</li>"+
                        "<li>Increase deductions for children and education</li>"+
                        "<li>Maintain the state sales tax deduction for Washington State citizens and fight to keep the home mortgage interest deduction in place.</li>"+
                        "<li>Renew the Economic Growth Tax Relief and Reconciliation Act of 2003.</li>"+
                        "<li>Repeal the Alternative Minimum Tax that was “designed” to eliminate loop holes for millionaires but is hurting moderate-income families instead.</li>"+
                        "</ol>";                                
        w.style.display = "block";
    }     
    else if (xItm == 6) //Afghanistan Objectives
    {
        var wCont = document.getElementById("divIssCnt");
     
        wCont.innerHTML = "The war in Afghanistan should not be influenced by political objectives at home.  The war in Iraq was a different war with clearly defined objectives.  Furthermore, the social, economic, and political environments of Iraq and Afghanistan are entirely different.  The goals in Afghanistan need to be clearly articulated recognizing the extreme difficulties in achieving the same goals as now possible in Iraq.  Al Qaeda is everywhere now and chasing a few in the mountains of Afghanistan is not the most prudent and efficient way of protecting the American People.  I will work to:"+
                         "<br />"+
                          "<ol>"+ 
                          "<li>Force the administration to prioritize the overall objectives of security against terrorism and to ensure that the safety of the American public comes before political objectives.</li>"+
                          "<li>Re-evaluate and obtain realistic objectives for Afghanistan.</li>"+
                          "<li>Allow the commanders in the field to call the ‘shots’ on the ground.</li>"+
                        "</ol>";                                
        w.style.display = "block";
    }  
    else if (xItm == 7)
    {
        var wCont = document.getElementById("divIssCnt");//National Security
     
        wCont.innerHTML = "The state of Washington is particularly vulnerable to attack from terrorists and rogue nations.  Our military installations, high-tech industries, trade routes, and most importantly, our citizens need better security.  Our waterways, air space, and border must be protected before a catastrophe occurs.  This is the responsibility of our Federal Government.  With my experience in the defense R&D industry, I will work to:"+
                      "<br />"+
                      "<ol>"+
                      "<li>Strengthen and better equip our military to keep us safe.</li>"+
                      "<li>Provide the best equipment and training for the men and women of our active duty military, Washington National Guard, and intelligence community.</li>"+
                      "<li>Promote efficient, competitive, and fair bidding for the procurement of military hardware without sending the contracts overseas.</li>"+
                      "  </ol>";
         w.style.display = "block";              
    }           
    else if (xItm == 8)
    {
        var wCont = document.getElementById("divIssCnt");//Border Security
     
        wCont.innerHTML = "As a border state Washington residents understand the importance of border security, but our national leaders apparently do not.  I realize that our nation was built upon the backs of hard working legal immigrants, and I support the continued policy of allowing legal immigrants into our country if they intend to help build this country.  But illegal aliens are a threat to our security and our economy.  I will work to: "+
                      "<br />"+
                      "<ol>"+
                      "  <li>Prevent amnesty for illegal aliens, and the Identifications that secure government benefits for illegal aliens.</li>"+
                      "  <li>Support the completion of a double fence along the US-Mexico border.</li>"+
                      "  <li>End automatic citizenship for children born here to illegal aliens.</li>"+
                      "  <li>Create stiffer penalties to employers who hire illegal aliens.</li> "+  
                      "  <li>Increase support for the Border Patrol to stop drug and human traffic.</li>"+
                      "  </ol>";
         w.style.display = "block";              
    }
    else if (xItm == 9) //Health Care
    {
        var wCont = document.getElementById("divIssCnt");
     
        wCont.innerHTML = "If there is one truly bipartisan fact to be found in the debate over health care reform, it is that costs need to be lowered.  I believe that all Americans should have health care coverage, but I am opposed to a government takeover that would raise taxes, reduce coverage for senior citizens on Medicare, and reduce the quality of care for everyone.  Our nation spends over $2.5 trillion dollars on health care every year, representing 17% of our total economy.  Health care costs have increased at twice the rate of inflation.  The most important step toward better health care coverage is improving our overall economy, but in the meantime we must get health care costs under control.  I will work to:"+
                          "<br />"+
                        "<ol>"+ 
                        "<li>Eliminate government mandates that force insurance providers to include peripheral and often unnecessary coverage such as acupuncture, hair prosthesis, personal trainers, in vitro fertilization, and many others that cause enormous cost increases.  People should have the flexibility to choose what coverage they need.</li>"+
                        "<li>Increase competition between insurance companies across state borders.  People should have the opportunity to shop nation-wide for health care as they do for auto insurance.  Furthermore, people should be able to take their health insurance policy with them if they move from one state to another.  Competition will lead to better products and reduced costs.</li>"+
                        "<li>Reform tort law so that frivolous lawsuits do not continue to drive up health care costs.  Currently defensive medicine expenses exceed tens of billions of dollars each year.  Capping allowable punitive damage awards and/or fundamentally changing the tort process would produce a definite reduction in the cost of our care.</li>"+
                        "<li>Modify health care savings plans so that the principal can be carried over from one year to the next if the amount in the plan is not fully expended.  In addition, instead of giving tax exemptions to corporations that provide health care, allow corporations to provide funding to their workers tax free, so that they may choose their own insurance. </li>"+
                        "</ol>";                                
        w.style.display = "block";
    }   
    else if (xItm == 10) //Housing Crisis
    {
        var wCont = document.getElementById("divIssCnt");
     
        wCont.innerHTML = "We now know that the housing crisis was caused by misguided political objectives and the lack of prudent regulatory enforcement of our financial institutions.  Although every citizen must be responsible for their debts, we need to seek a way assist this cause.  Many innocent people were taken advantage of because politicians were interested in votes and the big financial institutions wanted exorbitant profits.  I will work to:"+
                          "<br />"+
                          "<ol>"+ 
                          "<li>Enforce responsible regulatory requirements at the top of our financial institutions.</li>"+
                          "<li>Separately regulate commercial banking and investment institutions.</li>"+
                          "<li>Encourage and incentivize banks to agree to reasonable loan modifications so that people can work their way out of distressed situations.   </li>"+
                          "</ol>";                                
        w.style.display = "block";
    }                        	                                  
    doShowTitle(xItm);
    
    var sl = document.getElementById("ddIssues");
    sl.selectedIndex = 0;    
}

function doShowTitle(x)
{
    if (x == 1)
    {
      var wTitle1 = document.getElementById("winTTL");             
      wTitle1.innerHTML = "<b>Jobs and the Economy</b>"; 
    }
    else if (x == 2)
    {
      var wTitle1 = document.getElementById("winTTL");             
      wTitle1.innerHTML = "<b>Education</b>"; 
    }            
    else if (x == 3)
    {
      var wTitle1 = document.getElementById("winTTL");             
      wTitle1.innerHTML = "<b>Frivolous Lawsuits</b>"; 
    }
    else if (x == 4)
    {
      var wTitle1 = document.getElementById("winTTL");             
      wTitle1.innerHTML = "<b>Credit Card Companies</b>"; 
    }  
    else if (x == 5)
    {
      var wTitle1 = document.getElementById("winTTL");             
      wTitle1.innerHTML = "<b>Federal Income Tax</b>"; 
    }       
    else if (x == 6)
    {
      var wTitle1 = document.getElementById("winTTL");             
      wTitle1.innerHTML = "<b>Afghanistan Objectives</b>"; 
    }        
    else if (x == 7)
    {
      var wTitle1 = document.getElementById("winTTL");             
      wTitle1.innerHTML = "<b>National Security</b>"; 
    }
    else if (x == 8)
    {
      var wTitle1 = document.getElementById("winTTL");             
      wTitle1.innerHTML = "<b>Border Security</b>"; 
    }
    else if (x == 9)
    {
      var wTitle1 = document.getElementById("winTTL");             
      wTitle1.innerHTML = "<b>Health Care</b>"; 
    }  
    else if (x == 10)
    {
      var wTitle1 = document.getElementById("winTTL");             
      wTitle1.innerHTML = "<b>Housing Crisis</b>"; 
    }                                                                     
}

function getLeft(eElement)
{
    if (!eElement && this)                       // if argument is invalid
    {                                            // (not specified, is null or is 0)
        eElement = this;                         // and function is a method
    }                                            // identify the element as the method owner
    
    var nLeftPos = eElement.offsetLeft;          // initialize var to store calculations
    var eParElement = eElement.offsetParent;     // identify first offset parent element  
    while (eParElement != null)
    {                                            // move up through element hierarchy
        nLeftPos += eParElement.offsetLeft;      // appending left offset of each parent
        eParElement = eParElement.offsetParent;  // until no more offset parents exist
    }
    return nLeftPos;                             // return the number calculated
}


function getTop(eElement)
{
    if (!eElement && this)
    {
        eElement = this;
    }

    var nTopPos = eElement.offsetTop;
    var eParElement = eElement.offsetParent;
    while (eParElement != null)
    {
        nTopPos += eParElement.offsetTop;
        eParElement = eParElement.offsetParent;
    }
    return nTopPos;
}

function getPos(eElem)
{
    var xTop = getTop(eElem);
    var xLeft = getLeft(eElem);
    var w = document.getElementById("win2");
    w.style.left = xLeft;
    w.style.top = xTop + 20;
    w.style.display = "block";
    //alert("Pos is " + x);    
}

function closeIss()
{
    var w = document.getElementById("divIss");
    w.style.display = "none"; 
    closeUT();       
}

function closeUT()
{
    var w = document.getElementById("divUtube");
    w.style.display = "none";        
}
