﻿function ShowSendCVMyClipsPanel(){
var SendCVMyClipsPanel = document.getElementById('myclips_email_cv_panel');
    SendCVMyClipsPanel.style.display = 'inline';
}

function yesChecked() {
document.getElementById("ctl00_top_TabContainer1_TabPanel1_chkAttachCVno").checked = false;
document.getElementById("ctl00_top_TabContainer1_TabPanel1_chkAttachCVyes").checked = true;
}

function noChecked() {
document.getElementById("ctl00_top_TabContainer1_TabPanel1_chkAttachCVyes").checked = false;
document.getElementById("ctl00_top_TabContainer1_TabPanel1_chkAttachCVno").checked = true;
}


function showAds(){
	var gTopAd = document.getElementById("google_ad_top");
    gTopAd.style.display = 'inline';
    
    var gSideAd = document.getElementById("google_ads_frame2");
    gSideAd.style.display = 'inline';
    
        var videoPlayer = document.getElementById("video");
    videoPlayer.style.display = 'inline';

}

function hideAds(){
	var gTopAd = document.getElementById("google_ad_top");
    gTopAd.style.display = 'none';
    
    var gSideAd = document.getElementById("google_ads_frame2");
    gSideAd.style.display = 'none';
    
    var videoPlayer = document.getElementById("video");
    videoPlayer.style.display = 'none';
}


    function ShowApplyPopup() {

        var modal = $find('ctl00_top_ModalPopupExtender1');
        modal.show();
    }
   
	function HideApplyPopup() {
	
        var modal = $find('ctl00_top_ModalPopupExtender1');
        modal.hide();

    }




    function ShowContactPopup() {

        var modal = $find('ctl00_ModalPopupExtenderContact');
        modal.show();
    }
   
	function HideContactPopup() {
	
        var modal = $find('ctl00_ModalPopupExtenderContact');
        modal.hide();
    }


       function ShowChangePasswordPopup() {

        var modal = $find('ctl00_ModalPopupExtenderChangePassword');
        modal.show();
    }

    function HideChangePasswordPopup() {

        var modal = $find('ctl00_ModalPopupExtenderChangePassword');
        modal.hide();
    }
    
    
	
	function ShowReportPopup() {

	    var modal = $find('ctl00_top_ModalPopupExtenderReport');
        modal.show();
    }
   
	function HideReportPopup() {

	    var modal = $find('ctl00_top_ModalPopupExtenderReport');
        modal.hide();
    }

    function ShowForgotPopup() {
    	
        var modal = $find('ctl00_ModalPopupExtenderForgotPassword');
        modal.show();
    }

    function HideForgotPopup() {  
  
        var modal = $find('ctl00_ModalPopupExtenderForgotPassword');
        modal.hide();
    }


    function HidePersonalUserPopup() {

        var modal = $find('ctl00_top_ModalPopupExtenderNotPersonalUser');
        modal.hide();
    }
    
       
function setLoginFocus(){
    var t2 = document.getElementById('ctl00_Login1_Login1_UserName');
    t2.style.border = 'none';
    t2.focus(); 
    t2.value = t2.value; 
}

	


var secs
var timerID = null
var timerRunning = false
var delay = 1000

function InitializeTimer()
{
    // Set the length of the timer, in seconds
    secs = 5
    StopTheClock()
    StartTheTimer()
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer()
{
    if (secs==0)
    {
        StopTheClock()
        // Here's where you put something useful that's
        // supposed to happen after the allotted time.
        // For example, you could display a message:
        t2.style.border = '1px solid #6699CC';
        t2.style.backgroundColor = '#FFF';    }
    else
    {
        self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}


function func()
{
    var t2 = document.getElementById("t2");
    t2.focus(); 
    
    t2.value = t2.value; 
    t2.style.border = '3px solid Red';
    t2.style.backgroundColor = '#FFFFCC';
    
    
    InitializeTimer()
}


function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
cntfield.value = maxlimit - field.value.length;
}

function textCounterNoDisplay(field, maxlimit) {
    if (field.value.length > maxlimit) // if too long...trim it!
        field.value = field.value.substring(0, maxlimit);

}


function emailcheck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true					
	}

