﻿// JScript File
function OnOK()
{
}

function CancelEvent() 
{   
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    if (prm.get_isInAsyncPostBack()) 
    {
        prm.abortPostBack();
    }
}

function CancelEventWS()
{
    var submitButton = document.getElementById("<% = btnSubmit.ClientID %>");
    alert(submitButton.style.visibility);
    if(submitButton.style.visibility == "hidden")
    {
        submitButton.style.visibility = "visible";
    }
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    if (prm.get_isInAsyncPostBack()) 
    {
        prm.abortPostBack();
    }
}

function Hide()
{
    document.getElementById("<% = pnlPopUp.ClientID %>").style.visibility = "hidden";
}

function doClick(buttonName,e)
{
//the purpose of this function is to allow the enter key to 
//point to the correct button to click.
    var key;

     if(window.event)
     {
          key = window.event.keyCode;     //IE
          e = event;
     }
     else
          key = e.which;     //firefox
    
    if (key == 13)
    {
        //Get the button the user wants to have clicked
        var btn = document.getElementById(buttonName);
        if (btn != null)
        { //If we find the button click it
            btn.focus();
            return false;
        }
        else
        { return true; }
    }
}

var txt = "GoldStudent uses the latest SSL to ensure the security of your transactions."; 

var txtPrint = "Print this page";
//print for worksheets
function printPage()
{ 
	var disp_setting = "toolbar=no,location=no,directories=no,menubar=no,resizable=yes,scrollbars=yes,"; 
		disp_setting += "scrollbars=yes,width=870, height=850, left=10, top=10"; 
		
	var content_vlue1 = document.getElementById("divPrint1").innerHTML; 	
	var content_vlue2 = document.getElementById("divPrint2").innerHTML; 
    var content_vlue3 = document.getElementById("divPrint3").innerHTML;
    
	var docprint=window.open("","",disp_setting); 
	docprint.document.open(); 
	docprint.document.write('<html><head><script type="text/javascript" src="Scripts/jquery.min.js"></script><link href="style/print.css" rel="stylesheet" type="text/css" media="print" />');
	docprint.document.write('<style type="text/css">@import url(style/gs_structure.css);@import url(style/gs_global.css);@import url(style/gs_format.css);</style>');
	docprint.document.write('<style type="text/css">.noPrint, .hideLogIn {display: none;} .txtAnswer2{font-size: 14px; height:26px; padding:5px;} .problem_counter,.problem_description {font-size: 14px;} .txtBody {color:#3c3c3c; font-size: 12px;} .divTestInstruction, .divTestInstruction3, .divPanelProblem, .divHeaderWorksheet, .tblHeaderWorksheet, .divAnswerMsg2 {margin:0px 10px;} .print_copyR{display: block;} .print_logo{display: block;} .divTimer {display: none;}</style>');
	docprint.document.write('<title></title>');	
	docprint.document.write('</head><body style="min-width: 800px;">');
	docprint.document.write(content_vlue1);
	docprint.document.write(content_vlue2);
	docprint.document.write(content_vlue3);
	docprint.document.write('<br /><center><div id="divClose1" class="divCenter div30"><a class="text_link3" href="" onclick="javascript:window.close()" >Close window</a></div></center><br />');           
	docprint.document.write('</body></html>');
	docprint.document.close(); 
	docprint.focus(); 
}
//function for print from registration congratulation page
function PrintDiv2()
{
      var disp_setting = "toolbar=no,location=no,directories=no,menubar=no,resizable=yes,scrollbars=yes,";
			disp_setting += "scrollbars=yes,width=780, height=700, left=10, top=10";
      var content_vlue = document.getElementById("DivToPrint").innerHTML;
      var docprint=window.open("","",disp_setting);
	            docprint.document.write('<html><head><link href="style/print.css" rel="stylesheet" type="text/css" media="print" />');
                docprint.document.write('<style type="text/css">@import url(style/gs_structure.css);@import url(style/gs_global.css);@import url(style/gs_format.css);</style>');
                docprint.document.write('<style type="text/css">.print_logo{display: block;} .showLogIn{display: block;} .hideLogIn {display: none;} .borderRegConf1, .regHeaderStep {margin-left: 20px;} </style>');
                docprint.document.write('<title></title>'); docprint.document.write('</head><body style="min-width: 730px;">');
                docprint.document.write(content_vlue); docprint.document.write('<center><div id="divClose1" class="divCenter div30"><a class="text_link3" href="" onclick="javascript:window.close();">Close window</a></div></center><br />');
                docprint.document.write('</body></html>');
                docprint.document.close();docprint.focus();
}
//// functions for parent header       
function RedirectToHomePage()
{
      window.location = "Default.aspx";
}
function GoHomeParent()
{
    document.location.href ="GS_WelcomeParentPage.aspx";
}
function GoToStudyGuideParent()
{
    document.location.href ="GS_StudyGuide.aspx";
}
function GoToPointsAndPrizes()
{
    document.location.href ="GS_PointsPrizes.aspx";
}
function GoToResourcesHP()
{
   document.location.href ="GS_Resources.aspx"
}
function GoToAskUs()
{
    document.location.href ="GS_AskUsParent.aspx";
}
function GoToMyAcount()
{
    document.location.href ="GS_MyAccount.aspx";
}

//functions for not a member header
function GoHome()
{
    document.location.href ="Default.aspx";
}
function GoToStudents()
{
    document.location.href ="GS_StudentPage.aspx";
}
function GoToParents()
{
    document.location.href ="GS_ParentsPage.aspx";
}
function GoToEducators()
{
    document.location.href ="GS_EducatorPage.aspx";
}
function GoToHowItWorks()
{
    document.location.href ="GS_HowItWorks.aspx";
}
function GoToMentor()
{
    document.location.href ="GS_LandingPageMentor.aspx";
}
function GoToVideoTutorial()
{
    document.location.href ="GS_VideoTutorial.aspx";
}
//function from Mentor landing page
function GoToMentorRegistration()
{
    window.location.replace("GS_MentorProgram.aspx");
}

//Privacy Policy & Term of Use
function OpenPrivacyPolicy()
{
    window.open('PrivacyPolicy.aspx','GoldStudent1','height=500,width=700,left=100,top=100,resizable=yes,scrollbars=yes,target=new1,toolbar=0,status=0, menubar=0');
    return true;
}        
function OpenTermsOfUse()
{
    window.open('TermsOfUse.aspx','GoldStudent2','height=500,width=700,left=100,top=100,resizable=yes,scrollbars=yes,target=new2,toolbar=0,status=0, menubar=0');
    return true;
}

function OpenPrivacyPolicyF()
{
    window.open('PrivacyPolicy.aspx','GoldStudent1','height=500,width=700,left=100,top=100,resizable=yes,scrollbars=yes,target=new1,toolbar=0,status=0, menubar=0');
    return true;
}        
function OpenTermsOfUseF()
{
    window.open('TermsOfUse.aspx','GoldStudent2','height=500,width=700,left=100,top=100,resizable=yes,scrollbars=yes,target=new2,toolbar=0,status=0, menubar=0');
    return true;
}
function OpenOfferDetails()
{
    window.open('LandingPagePopUp.aspx','GoldStudentOfferDetails','height=720,width=650,left=50,top=50,resizable=yes,scrollbars=yes,target=new2,toolbar=0,status=0, menubar=0');
    return true;
}

////function from header Student
function GoHomeStudent()
{
    document.location.href ="GS_WelcomeStudentPage.aspx";
}
function GoToStudyGuideStudent()
{
    document.location.href ="GS_StudyGuide.aspx";
}
function GoToPointsAndPrizes()
{
    document.location.href ="GS_PointsPrizes.aspx";
}
function GoToResourcesHS()
{
    document.location.href ="GS_Resources.aspx"
}
function GoToAskUsStudent()
{
    document.location.href ="GS_AskUs.aspx?usr=2";
}
////Mentor
function GoHomeMentor()
{
    document.location.href ="GS_MentorHome.aspx";
}
function GoToMyAccountMentor()
{
    document.location.href ="GS_MentorMyAccount.aspx";
}
////Close Window
function OnClose()
{
    window.close();
}   
////_________________________________________________________
function goToStudentHomePage()
{
    document.location.href = "GS_WelcomeStudentPage.aspx";
}

//// Authorize.Net function
function OpenSecure()
{
    window.open('http://verify.authorize.net/anetseal/?pid=37dd2014-d627-43a1-9485-ba6af25f4e66&rurl=http%3A//www.goldstudent.com/GS_Registration.aspx','GoldStudent','height=500,width=700,left=100,top=100,resizable=yes,scrollbars=yes,target=new2,toolbar=no,status=yes');
    return true;
}
function OpenSSL()
{
    window.open('http://www.instantssl.com','GoldStudent2','height=500,width=700,left=100,top=100,resizable=yes,scrollbars=yes,target=new2,toolbar=no,status=yes');
    return true;
}

function goToParentHomePage()
{
    document.location.href = "GS_WelcomeParentPage.aspx";
}
/// nav right  /// nav left
function GoToReferAFriend()
{
    window.location.replace("GS_ReferAFriend.aspx");
}
function GoToPrizesRN()
{
    window.location.replace("GS_PointsPrizes.aspx");
}
function GoToResourcesRN()
{
    window.location.replace("GS_Resources.aspx");
}
function EnrollNow1()
{
  var link = document.getElementById("<% = hdnRegLinkRight.ClientID %>").value;
  document.location.href=link;
}
function EnrollNow2()
{
  var link = document.getElementById("<% = hdnRegLinkLeft.ClientID %>").value;
  document.location.href=link;
}
function EnrollNow()
{
  var link = document.getElementById("<% = hdnRegLink.ClientID %>").value;
  document.location.href=link;      
}
function GoToHowItWorks()
{
   document.location.href="GS_HowItWorks.aspx";
}

////five key
function Open1()
{
   window.open("Math-Study-Guides-Samples.aspx", "_self");
}
function Open2()
{
   window.open("GS_HowItWorks.aspx", "_self")
}
function Open3()
{
   window.open("GS_AskUs.aspx", "_self");
}
function Open4()
{
   window.open("GS_PointsPrizes.aspx", "_self");
}
function Open5()
{
   window.open("GS_ReferAFriend.aspx", "_self");
}
function Open11()
{
   window.open("Math-Study-Guides-Samples.aspx", "_self");
}
function Open12()
{
   window.open("Math-Worksheets-Samples.aspx", "_self");
}
function Open13()
{
   window.open("GS_PointsPrizes.aspx", "_self");
}
function Open14()
{
   window.open("Math-Quizzes-Samples.aspx", "_self");
}
function Open15()
{
   window.open("Math-Progress-Reports-Samples.aspx", "_self");
}
function Open31()
{
   window.open("GS_HowItWorks.aspx", "_self");
}
function Open32()
{
   window.open("Math-Worksheets-Samples.aspx", "_self");
}
function Open33()
{
   window.open("Math-Quizzes-Samples.aspx", "_self");
}
function Open34()
{
   window.open("GS_HowItWorks.aspx", "_self");
}
function Open35()
{
   window.open("Math-Progress-Reports-Samples.aspx", "_self");
}
function Open41()
{
   window.open("Math-Study-Guides-Samples.aspx", "_self");
}
function Open42()
{
   window.open("Math-Worksheets-Samples.aspx", "_self");
}
function Open43()
{
   window.open("Math-Quizzes-Samples.aspx", "_self");
}
function Open44()
{
   window.open("GS_AskUs.aspx", "_self");
}
function Open45()
{
   window.open("GS_ReferAFriend.aspx", "_self");
}

////forgot password
function OnOKForgotPass()
{
    window.location("GS_Signin_Signup.aspx")
}
////Mentor Home
function SendLink(url)
{
    var width = 710;
    var height = 650;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top + ',resizable=yes,scrollbars=yes,target=new2,toolbar=no';
    window.status="yes";
    window.open('MentorSendLink.aspx?link='+ url, 'new',windowFeatures);
}
//// Mentor Block Prizes ////refer step 2 -  PointsPrizesSKUDetails - PointsPrizeBasket
function ViewLageImage(idSKU)
{
    var width = 380;
    var height = 490;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    window.status="";
    window.open('PointsPrizeImage.aspx?id='+idSKU, 'new'+idSKU,windowFeatures)
}

function ViewLageImageAdmin(idSKU)
{
    var width = 380;
    var height = 490;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    window.status="";
    window.open('../PointsPrizeImage.aspx?id='+idSKU, 'new'+idSKU,windowFeatures)
}
////Resources Detail
function PrintDiv3()
{              
    var disp_setting = "toolbar=no,location=no,directories=no,menubar=no,resizable=yes,scrollbars=yes,"; 
		disp_setting += "scrollbars=yes,width=900, height=850, left=10, top=10";
    var content_vlue = document.getElementById("DivToPrint").innerHTML;
    var docprint=window.open("","",disp_setting); 
        docprint.document.write('<html><head><link href="style/print.css" rel="stylesheet" type="text/css" media="print" />');
        docprint.document.write('<style type="text/css">@import url(style/gs_structure.css);@import url(style/gs_global.css);@import url(style/gs_format.css);</style>');
        docprint.document.write('<style type="text/css">.print_logo{display: block;} .hideDiv{display: block;} .showDiv, h1#pagetitle{display: none;} .showLogIn{display: block;} .hideLogIn {display: none;} </style>');
        docprint.document.write('<title></title>'); docprint.document.write('</head><body style="padding: 10px 20px; min-width: 800px;">');	        
        docprint.document.write(content_vlue); docprint.document.write('<div id="divClose1" class="align-center div30"><a class="text_link3" href="" onclick="javascript:window.close();">Close window</a></div><br />'); 
        docprint.document.write('</body></html>');
        docprint.document.close();docprint.focus();        
}

function hidestatus()
{
    window.status="";
    return true;
}
////prize header
function PrizeBasket()
{
    window.location.replace("GS_PointsPrizes.aspx?pg=4");
}
/////////////
var txtPointsLeft = "This shows the available points you have to redeem for more prizes.  It includes the points for the prizes in your basket that you have not committed yet.";
var txtPrizeBasket = "This shows the number of prizes you have put in your prize basket.  Click the button if you want to see what you have in your prize basket.";
var txtUpdatePrizeBtn = "If you changed anything in the prize basket, click this button to update the numbers.";
//// Points and Prizes Image
var statusmsg=""
function hidestatus()
{
    window.status=statusmsg;
    return true;
}
//// Points and Prize Category
function GoPointsSystem()
{
    document.location.href ="GS_PointsPrizesSystem.aspx";
}
////_________________________________________________________
function GoBack()
{
    history.go(-1)
}

///___________________________________________________________
function OpenSampleWorksheets()
{
    var cmb = document.getElementById("<% = cmbWorksheetsView.ClientID %>");
    var grade = cmb.selectedIndex;
    switch(grade)
    {
        case 1:
            window.open('GS_SamplePage.aspx?id=1&grade=1&h=1', 'GoldStudent', 'resizable=yes,scrollbars=yes,target=new,toolbar=0,status=0, menubar=0');
            break;    
        case 2:
            window.open('GS_SamplePage.aspx?id=1&grade=2&h=1', 'GoldStudent', 'resizable=yes,scrollbars=yes,target=new,toolbar=0,status=0, menubar=0');
            break;
        case 3:
            window.open('GS_SamplePage.aspx?id=1&grade=3&h=1', 'GoldStudent', 'resizable=yes,scrollbars=yes,target=new,toolbar=0,status=0, menubar=0');
            break;
        case 4:
            window.open('GS_SamplePage.aspx?id=1&grade=4&h=1', 'GoldStudent', 'resizable=yes,scrollbars=yes,target=new,toolbar=0,status=0, menubar=0');
            break;
        case 5:
            window.open('GS_SamplePage.aspx?id=1&grade=5&h=1', 'GoldStudent', 'resizable=yes,scrollbars=yes,target=new,toolbar=0,status=0, menubar=0');
            break;
        case 6:
            window.open('GS_SamplePage.aspx?id=1&grade=6&h=1', 'GoldStudent', 'resizable=yes,scrollbars=yes,target=new,toolbar=0,status=0, menubar=0');
            break;
        default:
            break;
    }
}

function ShowGlossary(g)
{
    window.open('Glossary.aspx?glossary='+g,'newG','height=670,width=700,left=100,top=100,resizable=yes,scrollbars=yes,target=new1,toolbar=0,status=0, menubar=0');
    return true;
}

function ShowSurvey()
{
    window.open('Survey.aspx?value=cancel', 'Survey', 'height=670, width=700, left=100, top=100, resizable=no, scrollbars=yes, target=new1, toolbar=0, status=0, menubar=0');
    return true;
}

function ShowVideo(videoPath, videoid)
{
    var leftIndex = parseInt((screen.availWidth/2)-220);
    var topIndex = parseInt((screen.availHeight/2)-450);
    newwindow = window.open("VideoPage.aspx?video=" + videoPath + "&videoid=" + videoid, "newV", "width = 445, height = 835, left= " + leftIndex + ", top = " + topIndex + ",titlebar=yes, resizable=yes,scrollbars=no,target=new1,toolbar=0, menubar=0, status=0");
    if (window.focus) {newwindow.focus();}
	return true;
}

function openVideoTranscriptPage(videoTutorialID)
{
    var leftIndex = parseInt((screen.availWidth/2)-30);
    var topIndex = parseInt((screen.availHeight/2)-100); 
    window.open("VideoTranscription.aspx?vTID="+videoTutorialID, "newTP", "width = 445, height = 450, left= " + leftIndex + ", top = " + topIndex + ", resizable=no,scrollbars=no,target=new,toolbar=0, menubar=0");
    return true; 
}

function printTranscriptionPage()
{ 
	window.print();
}

function OpenVideoGlossary()
{
    var width = 720;
    var height = 700;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    window.open("Video.aspx?video=all","newVG","width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top + ", resizable=yes,scrollbars=yes,target=new,toolbar=0,menubar=0");
}

//facebook share
function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}

