﻿//var swfobject=function(){var Z="undefined",P="object",B="Shockwave Flash",h="ShockwaveFlash.ShockwaveFlash",W="application/x-shockwave-flash",K="SWFObjectExprInst",G=window,g=document,N=navigator,f=[],H=[],Q=null,L=null,T=null,S=false,C=false;var a=function(){var l=typeof g.getElementById!=Z&&typeof g.getElementsByTagName!=Z&&typeof g.createElement!=Z&&typeof g.appendChild!=Z&&typeof g.replaceChild!=Z&&typeof g.removeChild!=Z&&typeof g.cloneNode!=Z,t=[0,0,0],n=null;if(typeof N.plugins!=Z&&typeof N.plugins[B]==P){n=N.plugins[B].description;if(n){n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1");t[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10);t[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10);t[2]=/r/.test(n)?parseInt(n.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof G.ActiveXObject!=Z){var o=null,s=false;try{o=new ActiveXObject(h+".7")}catch(k){try{o=new ActiveXObject(h+".6");t=[6,0,21];o.AllowScriptAccess="always"}catch(k){if(t[0]==6){s=true}}if(!s){try{o=new ActiveXObject(h)}catch(k){}}}if(!s&&o){try{n=o.GetVariable("$version");if(n){n=n.split(" ")[1].split(",");t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]}}catch(k){}}}}var v=N.userAgent.toLowerCase(),j=N.platform.toLowerCase(),r=/webkit/.test(v)?parseFloat(v.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,i=false,q=j?/win/.test(j):/win/.test(v),m=j?/mac/.test(j):/mac/.test(v);/*@cc_on i=true;@if(@_win32)q=true;@elif(@_mac)m=true;@end@*/return{w3cdom:l,pv:t,webkit:r,ie:i,win:q,mac:m}}();var e=function(){if(!a.w3cdom){return }J(I);if(a.ie&&a.win){try{g.write("<script id=__ie_ondomload defer=true src=//:><\/script>");var i=c("__ie_ondomload");if(i){i.onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);V()}}}}catch(j){}}if(a.webkit&&typeof g.readyState!=Z){Q=setInterval(function(){if(/loaded|complete/.test(g.readyState)){V()}},10)}if(typeof g.addEventListener!=Z){g.addEventListener("DOMContentLoaded",V,null)}M(V)}();function V(){if(S){return }if(a.ie&&a.win){var m=Y("span");try{var l=g.getElementsByTagName("body")[0].appendChild(m);l.parentNode.removeChild(l)}catch(n){return }}S=true;if(Q){clearInterval(Q);Q=null}var j=f.length;for(var k=0;k<j;k++){f[k]()}}function J(i){if(S){i()}else{f[f.length]=i}}function M(j){if(typeof G.addEventListener!=Z){G.addEventListener("load",j,false)}else{if(typeof g.addEventListener!=Z){g.addEventListener("load",j,false)}else{if(typeof G.attachEvent!=Z){G.attachEvent("onload",j)}else{if(typeof G.onload=="function"){var i=G.onload;G.onload=function(){i();j()}}else{G.onload=j}}}}}function I(){var l=H.length;for(var j=0;j<l;j++){var m=H[j].id;if(a.pv[0]>0){var k=c(m);if(k){H[j].width=k.getAttribute("width")?k.getAttribute("width"):"0";H[j].height=k.getAttribute("height")?k.getAttribute("height"):"0";if(O(H[j].swfVersion)){if(a.webkit&&a.webkit<312){U(k)}X(m,true)}else{if(H[j].expressInstall&&!C&&O("6.0.65")&&(a.win||a.mac)){D(H[j])}else{d(k)}}}}else{X(m,true)}}}function U(m){var k=m.getElementsByTagName(P)[0];if(k){var p=Y("embed"),r=k.attributes;if(r){var o=r.length;for(var n=0;n<o;n++){if(r[n].nodeName.toLowerCase()=="data"){p.setAttribute("src",r[n].nodeValue)}else{p.setAttribute(r[n].nodeName,r[n].nodeValue)}}}var q=k.childNodes;if(q){var s=q.length;for(var l=0;l<s;l++){if(q[l].nodeType==1&&q[l].nodeName.toLowerCase()=="param"){p.setAttribute(q[l].getAttribute("name"),q[l].getAttribute("value"))}}}m.parentNode.replaceChild(p,m)}}function F(i){if(a.ie&&a.win&&O("8.0.0")){G.attachEvent("onunload",function(){var k=c(i);if(k){for(var j in k){if(typeof k[j]=="function"){k[j]=function(){}}}k.parentNode.removeChild(k)}})}}function D(j){C=true;var o=c(j.id);if(o){if(j.altContentId){var l=c(j.altContentId);if(l){L=l;T=j.altContentId}}else{L=b(o)}if(!(/%$/.test(j.width))&&parseInt(j.width,10)<310){j.width="310"}if(!(/%$/.test(j.height))&&parseInt(j.height,10)<137){j.height="137"}g.title=g.title.slice(0,47)+" - Flash Player Installation";var n=a.ie&&a.win?"ActiveX":"PlugIn",k=g.title,m="MMredirectURL="+G.location+"&MMplayerType="+n+"&MMdoctitle="+k,p=j.id;if(a.ie&&a.win&&o.readyState!=4){var i=Y("div");p+="SWFObjectNew";i.setAttribute("id",p);o.parentNode.insertBefore(i,o);o.style.display="none";G.attachEvent("onload",function(){o.parentNode.removeChild(o)})}R({data:j.expressInstall,id:K,width:j.width,height:j.height},{flashvars:m},p)}}function d(j){if(a.ie&&a.win&&j.readyState!=4){var i=Y("div");j.parentNode.insertBefore(i,j);i.parentNode.replaceChild(b(j),i);j.style.display="none";G.attachEvent("onload",function(){j.parentNode.removeChild(j)})}else{j.parentNode.replaceChild(b(j),j)}}function b(n){var m=Y("div");if(a.win&&a.ie){m.innerHTML=n.innerHTML}else{var k=n.getElementsByTagName(P)[0];if(k){var o=k.childNodes;if(o){var j=o.length;for(var l=0;l<j;l++){if(!(o[l].nodeType==1&&o[l].nodeName.toLowerCase()=="param")&&!(o[l].nodeType==8)){m.appendChild(o[l].cloneNode(true))}}}}}return m}function R(AE,AC,q){var p,t=c(q);if(typeof AE.id==Z){AE.id=q}if(a.ie&&a.win){var AD="";for(var z in AE){if(AE[z]!=Object.prototype[z]){if(z=="data"){AC.movie=AE[z]}else{if(z.toLowerCase()=="styleclass"){AD+=' class="'+AE[z]+'"'}else{if(z!="classid"){AD+=" "+z+'="'+AE[z]+'"'}}}}}var AB="";for(var y in AC){if(AC[y]!=Object.prototype[y]){AB+='<param name="'+y+'" value="'+AC[y]+'" />'}}t.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AD+">"+AB+"</object>";F(AE.id);p=c(AE.id)}else{if(a.webkit&&a.webkit<312){var AA=Y("embed");AA.setAttribute("type",W);for(var x in AE){if(AE[x]!=Object.prototype[x]){if(x=="data"){AA.setAttribute("src",AE[x])}else{if(x.toLowerCase()=="styleclass"){AA.setAttribute("class",AE[x])}else{if(x!="classid"){AA.setAttribute(x,AE[x])}}}}}for(var w in AC){if(AC[w]!=Object.prototype[w]){if(w!="movie"){AA.setAttribute(w,AC[w])}}}t.parentNode.replaceChild(AA,t);p=AA}else{var s=Y(P);s.setAttribute("type",W);for(var v in AE){if(AE[v]!=Object.prototype[v]){if(v.toLowerCase()=="styleclass"){s.setAttribute("class",AE[v])}else{if(v!="classid"){s.setAttribute(v,AE[v])}}}}for(var u in AC){if(AC[u]!=Object.prototype[u]&&u!="movie"){E(s,u,AC[u])}}t.parentNode.replaceChild(s,t);p=s}}return p}function E(k,i,j){var l=Y("param");l.setAttribute("name",i);l.setAttribute("value",j);k.appendChild(l)}function c(i){return g.getElementById(i)}function Y(i){return g.createElement(i)}function O(k){var j=a.pv,i=k.split(".");i[0]=parseInt(i[0],10);i[1]=parseInt(i[1],10);i[2]=parseInt(i[2],10);return(j[0]>i[0]||(j[0]==i[0]&&j[1]>i[1])||(j[0]==i[0]&&j[1]==i[1]&&j[2]>=i[2]))?true:false}function A(m,j){if(a.ie&&a.mac){return }var l=g.getElementsByTagName("head")[0],k=Y("style");k.setAttribute("type","text/css");k.setAttribute("media","screen");if(!(a.ie&&a.win)&&typeof g.createTextNode!=Z){k.appendChild(g.createTextNode(m+" {"+j+"}"))}l.appendChild(k);if(a.ie&&a.win&&typeof g.styleSheets!=Z&&g.styleSheets.length>0){var i=g.styleSheets[g.styleSheets.length-1];if(typeof i.addRule==P){i.addRule(m,j)}}}function X(k,i){var j=i?"visible":"hidden";if(S){c(k).style.visibility=j}else{A("#"+k,"visibility:"+j)}}return{registerObject:function(l,i,k){if(!a.w3cdom||!l||!i){return }var j={};j.id=l;j.swfVersion=i;j.expressInstall=k?k:false;H[H.length]=j;X(l,false)},getObjectById:function(l){var i=null;if(a.w3cdom&&S){var j=c(l);if(j){var k=j.getElementsByTagName(P)[0];if(!k||(k&&typeof j.SetVariable!=Z)){i=j}else{if(typeof k.SetVariable!=Z){i=k}}}}return i},embedSWF:function(n,u,r,t,j,m,k,p,s){if(!a.w3cdom||!n||!u||!r||!t||!j){return }r+="";t+="";if(O(j)){X(u,false);var q=(typeof s==P)?s:{};q.data=n;q.width=r;q.height=t;var o=(typeof p==P)?p:{};if(typeof k==P){for(var l in k){if(k[l]!=Object.prototype[l]){if(typeof o.flashvars!=Z){o.flashvars+="&"+l+"="+k[l]}else{o.flashvars=l+"="+k[l]}}}}J(function(){R(q,o,u);if(q.id==u){X(u,true)}})}else{if(m&&!C&&O("6.0.65")&&(a.win||a.mac)){X(u,false);J(function(){var i={};i.id=i.altContentId=u;i.width=r;i.height=t;i.expressInstall=m;D(i)})}}},getFlashPlayerVersion:function(){return{major:a.pv[0],minor:a.pv[1],release:a.pv[2]}},hasFlashPlayerVersion:O,createSWF:function(k,j,i){if(a.w3cdom&&S){return R(k,j,i)}else{return undefined}},createCSS:function(j,i){if(a.w3cdom){A(j,i)}},addDomLoadEvent:J,addLoadEvent:M,getQueryParamValue:function(m){var l=g.location.search||g.location.hash;if(m==null){return l}if(l){var k=l.substring(1).split("&");for(var j=0;j<k.length;j++){if(k[j].substring(0,k[j].indexOf("="))==m){return k[j].substring((k[j].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(C&&L){var i=c(K);if(i){i.parentNode.replaceChild(L,i);if(T){X(T,true);if(a.ie&&a.win){L.style.display="block"}}L=null;T=null;C=false}}}}}();
//var playerVersion = swfobject.getFlashPlayerVersion();
function dropFunction(val)
{
    for (var i = 1; i < 11; i++)
    {
        document.getElementById('divKid'+i).style.visibility = "hidden";
        document.getElementById('divKid'+i).style.height = "0px";
        document.getElementById('divKid'+i).style.margin = "0px 0px 0px 0px";
        document.getElementById('divKid'+i).style.padding = "0px 0px 0px 0px";
        
        document.getElementById('divKid'+i+'a').style.visibility = "hidden";
        document.getElementById('divKid'+i+'a').style.height = "0px";
        document.getElementById('divKid'+i+'a').style.margin = "0px 0px 0px 0pxx";
        document.getElementById('divKid'+i+'a').style.padding = "0px 0px 0px 0px";

        document.getElementById('divKid'+i+'b').style.visibility = "hidden";
        document.getElementById('divKid'+i+'b').style.height = "0px";
        document.getElementById('divKid'+i+'b').style.margin = "0px 0px 0px 0px";
        document.getElementById('divKid'+i+'b').style.padding = "0px 0px 0px 0px";

        document.getElementById('cellKid'+i+'a').style.visibility = "hidden";
        document.getElementById('cellKid'+i+'a').style.height = "0px";
        document.getElementById('cellKid'+i+'a').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'a').style.padding = "0px 0px 0px 0px";

        
        document.getElementById('cellKid'+i+'b').style.visibility = "hidden";
        document.getElementById('cellKid'+i+'b').style.height = "0px";
        document.getElementById('cellKid'+i+'b').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'b').style.padding = "0px 0px 0px 0px";

        /*document.getElementById('cellKid'+i+'c').style.visibility = "hidden";
        document.getElementById('cellKid'+i+'c').style.height = "0px";
        document.getElementById('cellKid'+i+'c').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'c').style.padding = "0px 0px 0px 0px";

        document.getElementById('cellKid'+i+'c').style.visibility = "hidden";
        document.getElementById('cellKid'+i+'d').style.height = "0px";
        document.getElementById('cellKid'+i+'d').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'c').style.padding = "0px 0px 0px 0px";
        */
        
        if (i > val)
        {
        document.getElementById('tbxKID'+i+'NAME').value = "";
        //document.getElementById('tbxKID'+i+'BIRTHDAY').value = "";
        }
        
    }
    
    for (var i = 1; i <= val; i++)
    {
        document.getElementById('divKid'+i).style.visibility = "visible";
        document.getElementById('divKid'+i).style.height = "30px";
        document.getElementById('divKid'+i).style.margin = "0px 0px 0px 0px";
        document.getElementById('divKid'+i).style.padding = "0px 0px 0px 0px";
        
        document.getElementById('divKid'+i+'a').style.visibility = "visible";
        document.getElementById('divKid'+i+'a').style.height = "30px";
        document.getElementById('divKid'+i+'a').style.margin = "0px 0px 0px 0pxx";
        document.getElementById('divKid'+i+'a').style.padding = "0px 0px 0px 0px";

        document.getElementById('divKid'+i+'b').style.visibility = "visible";
        document.getElementById('divKid'+i+'b').style.height = "30px";
        document.getElementById('divKid'+i+'b').style.margin = "0px 0px 0px 0px";
        document.getElementById('divKid'+i+'b').style.padding = "0px 0px 0px 0px";

        document.getElementById('cellKid'+i+'a').style.visibility = "visible";
        document.getElementById('cellKid'+i+'a').style.height = "30px";
        document.getElementById('cellKid'+i+'a').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'a').style.padding = "0px 0px 0px 0px";

        document.getElementById('cellKid'+i+'b').style.visibility = "visible";
        document.getElementById('cellKid'+i+'b').style.height = "30px";
        document.getElementById('cellKid'+i+'b').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'b').style.padding = "0px 0px 0px 0px";

        /*
        document.getElementById('cellKid'+i+'c').style.visibility = "visible";
        document.getElementById('cellKid'+i+'c').style.height = "30px";
        document.getElementById('cellKid'+i+'c').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'c').style.padding = "0px 0px 0px 0px";

        document.getElementById('cellKid'+i+'c').style.visibility = "visible";
        document.getElementById('cellKid'+i+'d').style.height = "30px";
        document.getElementById('cellKid'+i+'d').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'c').style.padding = "0px 0px 0px 0px";
        */
    }
    
}
        
function setDropDown(val)
{
    for (var i = 1; i < 11; i++)
    {
        document.getElementById('divKid'+i).style.visibility = "hidden";
        document.getElementById('divKid'+i).style.height = "0px";
        document.getElementById('divKid'+i).style.margin = "0px 0px 0px 0px";
        document.getElementById('divKid'+i).style.padding = "0px 0px 0px 0px";
        
        document.getElementById('divKid'+i+'a').style.visibility = "hidden";
        document.getElementById('divKid'+i+'a').style.height = "0px";
        document.getElementById('divKid'+i+'a').style.margin = "0px 0px 0px 0pxx";
        document.getElementById('divKid'+i+'a').style.padding = "0px 0px 0px 0px";

        document.getElementById('divKid'+i+'b').style.visibility = "hidden";
        document.getElementById('divKid'+i+'b').style.height = "0px";
        document.getElementById('divKid'+i+'b').style.margin = "0px 0px 0px 0px";
        document.getElementById('divKid'+i+'b').style.padding = "0px 0px 0px 0px";

        document.getElementById('cellKid'+i+'a').style.visibility = "hidden";
        document.getElementById('cellKid'+i+'a').style.height = "0px";
        document.getElementById('cellKid'+i+'a').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'a').style.padding = "0px 0px 0px 0px";

        document.getElementById('cellKid'+i+'b').style.visibility = "hidden";
        document.getElementById('cellKid'+i+'b').style.height = "0px";
        document.getElementById('cellKid'+i+'b').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'b').style.padding = "0px 0px 0px 0px";

        /*document.getElementById('cellKid'+i+'c').style.visibility = "hidden";
        document.getElementById('cellKid'+i+'c').style.height = "0px";
        document.getElementById('cellKid'+i+'c').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'c').style.padding = "0px 0px 0px 0px";

        document.getElementById('cellKid'+i+'c').style.visibility = "hidden";
        document.getElementById('cellKid'+i+'d').style.height = "0px";
        document.getElementById('cellKid'+i+'d').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'c').style.padding = "0px 0px 0px 0px";
        */
    }
    
    for (var i = 1; i <= val; i++)
    {
        document.getElementById('divKid'+i).style.visibility = "visible";
        document.getElementById('divKid'+i).style.height = "30px";
        document.getElementById('divKid'+i).style.margin = "0px 0px 0px 0px";
        document.getElementById('divKid'+i).style.padding = "0px 0px 0px 0px";
        
        document.getElementById('divKid'+i+'a').style.visibility = "visible";
        document.getElementById('divKid'+i+'a').style.height = "30px";
        document.getElementById('divKid'+i+'a').style.margin = "0px 0px 0px 0pxx";
        document.getElementById('divKid'+i+'a').style.padding = "0px 0px 0px 0px";

        document.getElementById('divKid'+i+'b').style.visibility = "visible";
        document.getElementById('divKid'+i+'b').style.height = "30px";
        document.getElementById('divKid'+i+'b').style.margin = "0px 0px 0px 0px";
        document.getElementById('divKid'+i+'b').style.padding = "0px 0px 0px 0px";

        document.getElementById('cellKid'+i+'a').style.visibility = "visible";
        document.getElementById('cellKid'+i+'a').style.height = "30px";
        document.getElementById('cellKid'+i+'a').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'a').style.padding = "0px 0px 0px 0px";

        document.getElementById('cellKid'+i+'b').style.visibility = "visible";
        document.getElementById('cellKid'+i+'b').style.height = "30px";
        document.getElementById('cellKid'+i+'b').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'b').style.padding = "0px 0px 0px 0px";

        /*document.getElementById('cellKid'+i+'c').style.visibility = "visible";
        document.getElementById('cellKid'+i+'c').style.height = "30px";
        document.getElementById('cellKid'+i+'c').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'c').style.padding = "0px 0px 0px 0px";

        document.getElementById('cellKid'+i+'c').style.visibility = "visible";
        document.getElementById('cellKid'+i+'d').style.height = "30px";
        document.getElementById('cellKid'+i+'d').style.margin = "0px 0px 0px 0px";
        document.getElementById('cellKid'+i+'c').style.padding = "0px 0px 0px 0px";
        */
    }
    
}
        
function textCounter(field, countfield, maxlimit) 
{
    if (field.value.length > maxlimit) // if too long...trim it!
    field.value = field.value.substring(0, maxlimit);
    // otherwise, update 'characters left' counter
    else 
    countfield.value = maxlimit - field.value.length;
}

function MM_openBrWindow(theURL,winName,features) 
        { 
            window.open(theURL,winName,features);
        }
	    
function ValidateTbxPhoneNumberType(source, args)
{
    if (document.getElementById('tbxOTHERPHONENUMBER').value.length > 0)
    {
        // if tbx has text, and selected index is 0, then false
        if (document.getElementById('ddlPHONENUMBERTYPE').selectedIndex == 0)
        {
            args.IsValid = false;
        }
        // if tbx has text, and selected index is > 1, then true
        else if (document.getElementById('ddlPHONENUMBERTYPE').selectedIndex > 0)
        {
            args.IsValid = true;
        }
        else
        {
            args.IsValid = false;
        }
    }
    else if (document.getElementById('tbxOTHERPHONENUMBER').value.length > 0)
    {
        // if textbox has text and selected index is 0, then false
        if (document.getElementById('ddlPHONENUMBERTYPE').selectedIndex == 0)
        {
            args.IsValid = false;
        }
        // if textbox has text, and selected index is greater than 0, then true
        else if (document.getElementById('ddlPHONENUMBERTYPE').selectedIndex > 0)
        {   
            args.IsValid = true;
        }
        else
        {
            args.IsValid = false;
        }
    }
}

function ValidateDdlLocations3(source, args) 
{
    if (document.getElementById('ddlLocations3').selectedIndex == 0) {
        args.IsValid = false;
    }
    else if (document.getElementById('ddlLocations3').selectedIndex > 0) {
        args.IsValid = true;
    }
    else {
        args.IsValid = false;
    }
}

function ValidateDdlOccasions2(source, args) {
    if (document.getElementById('ddlOccasions2').selectedIndex == 0) {
        args.IsValid = false;
    }
    else if (document.getElementById('ddlOccasions2').selectedIndex > 0) {
        args.IsValid = true;
    }
    else {
        args.IsValid = false;
    }
}
         
function ValidateDdlPhoneNumberType(source, args) 
{ 
    // Check if there is an entry in the text box
    if (document.getElementById('tbxOTHERPHONENUMBER').value.length > 0) 
    { 
        // if box has text, and dropdown has selection or equal to 1, then true
        if (document.getElementById('ddlPHONENUMBERTYPE').selectedIndex >= 1) 
        { 
            args.IsValid = true; 
        } 
        // if box has text, and dropdown is equal to 0, then false
        else if (document.getElementById('ddlPHONENUMBERTYPE').selectedIndex < 1)
        {
            args.IsValid = false;
        }
        else 
        { 
            args.IsValid = false; 
        } 
    }
    // If there is a blank entry in the text box
    else if (document.getElementById('tbxOTHERPHONENUMBER').value.length == 0)
    {
        // if box is empty, and dropdown has selection, then false
        if (document.getElementById('ddlPHONENUMBERTYPE').selectedIndex >= 1) 
        { 
            args.IsValid = false; 
        } 
        // if box is empty, and dropdown is empty, then true
        else if (document.getElementById('ddlPHONENUMBERTYPE').selectedIndex < 1) 
        {
            argsi.IsValid = true;
        }
        else 
        { 
            args.IsValid = true; 
        } 
    } 
    else 
    { 
        args.IsValid = true; 
    } 
}


function ValidateTC(source, args) 
{ 
    args.IsValid = document.getElementById('cbxCONFIRMPRIVACY').checked;
}
        

function ValidateAge(source, args)
{
    var submittedAge = getAge(document.getElementById('tbxBIRTHDAY').value);
    var requiredAge = 21;
    
    if (submittedAge == requiredAge)
    {
        args.IsValid = true;
    }
    else if (submittedAge > requiredAge)
    {
        args.IsValid = true;
    }
    else
    {
        args.IsValid = false;
    }
}

function getAge(dateStr) 
{
    var now = new Date();
    var birthdate = new Date(dateStr);

    if(birthdate.getTime() > now.getTime())
    return 0;

    var diff = now.getTime() - birthdate.getTime();
    //return Math.floor(diff / (1000*60*60*24*365));
    return Math.floor(diff / (1000*60*60*24*365));
}

// Global.js
var d = document;
var q=location.search;
var ua = navigator.userAgent.toLowerCase();
var macIE4 = (ua.indexOf("mac") != -1 && ua.indexOf("msie") != -1)?true:false;
var macSafari = (ua.indexOf("mac") != -1 && ua.indexOf("safari") != -1)?true:false;
var macNetscape = (ua.indexOf("mac") != -1 && ua.indexOf("netscape") != -1)?true:false;
var pcIE = (ua.indexOf("windows") != -1 && ua.indexOf("msie") != -1)?true:false;
var pcFF = (ua.indexOf("windows") != -1 && ua.indexOf("firefox") != -1)?true:false;
var MMredirectURL = window.location;
var MMplayerType = "PlugIn";
var MMdoctitle = document.title;
if (pcIE) {
	MMplayerType = "ActiveX";
}
var siteDomain = d.domain;
var domainHeader = siteDomain.split(".");
var domHeader = "";
if (domainHeader[0] == "dev" || domainHeader[0] == "preview" || domainHeader[0] == "dev6" || domainHeader[0] == "preview6"){
	domHeader = "preview.";
}

var ID_TOKEN = "id=";
var AMP_TOKEN = "&";
var NAME_TOKEN = "name=";
var IMG_TOKEN = "imgpath=";
var SECTION_TOKEN = "section=";
var OID_TOKEN = "oid=";
var SIZE_TOKEN = "size=";
var PATH_TOKEN = "path=";

// ***** PARSE FOR ID TOKEN *****
var id = q.substring(q.indexOf(ID_TOKEN) + ID_TOKEN.length);
if (id.indexOf(AMP_TOKEN) >= 0){
	id = id.substring(0, id.indexOf(AMP_TOKEN));
}

// ***** PARSE FOR NAME TOKEN *****
var name = q.substring(q.indexOf(NAME_TOKEN) + NAME_TOKEN.length);
if (q.indexOf(NAME_TOKEN) >= 0){
	if (name.indexOf(AMP_TOKEN) >= 0){
		name = name.substring(0, name.indexOf(AMP_TOKEN));
	}
}
// ***** PARSE FOR IMGPATH TOKEN *****
var imgpath = q.substring(q.indexOf(IMG_TOKEN) + IMG_TOKEN.length);
if (q.indexOf(IMG_TOKEN) >= 0){
	if (imgpath.indexOf(AMP_TOKEN) >= 0){
		imgpath = imgpath.substring(0, imgpath.indexOf(AMP_TOKEN));
	}
}
// ***** PARSE FOR SECTION TOKEN *****
var section = q.substring(q.indexOf(SECTION_TOKEN) + SECTION_TOKEN.length);
if (q.indexOf(SECTION_TOKEN) >= 0){
	if (section.indexOf(AMP_TOKEN) >= 0){
		section = section.substring(0, section.indexOf(AMP_TOKEN));
	}
}
// ***** PARSE FOR OID TOKEN *****
var oid = q.substring(q.indexOf(OID_TOKEN) + OID_TOKEN.length);
if (q.indexOf(OID_TOKEN) >= 0){
	if (oid.indexOf(AMP_TOKEN) >= 0){
		oid = oid.substring(0, oid.indexOf(AMP_TOKEN));
	}
}
// ***** PARSE FOR SIZE TOKEN *****
var size = q.substring(q.indexOf(SIZE_TOKEN) + SIZE_TOKEN.length);
if (q.indexOf(SIZE_TOKEN) >= 0){
	if (size.indexOf(AMP_TOKEN) >= 0){
		size = size.substring(0, size.indexOf(AMP_TOKEN));
	}
}
// ***** PARSE FOR PATH TOKEN *****
var path = q.substring(q.indexOf(PATH_TOKEN) + PATH_TOKEN.length);
if (q.indexOf(PATH_TOKEN) >= 0){
	if (path.indexOf(AMP_TOKEN) >= 0){
		path = path.substring(0, path.indexOf(AMP_TOKEN));
	}
}
// ***** FLASH EMBED *****
var embedVar = "";
var swfTransparent = false;
function flashEmbed(FLASHPATH,WIDTH,HEIGHT,BGCOLOR,QUALITY,MENU,BORDER,TRANSPARENT,FLASHVARS) {
	var hasParams = (FLASHPATH.indexOf("?") != -1)?true:false;
	var pathConcat = "?";
	if (hasParams) {
		pathConcat = "&";
	}
	if ((pcIE && TRANSPARENT != undefined) || swfTransparent) {
		embedVar = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\""+WIDTH+"\" height=\""+HEIGHT+"\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=\""+FLASHPATH+pathConcat+"domHeader="+domHeader+"&section="+section+"&MMredirectURL="+escape(MMredirectURL)+"&MMplayerType="+MMplayerType+"&MMdoctitle="+MMdoctitle+"&pcIE="+pcIE+"&eos=true\" /><param name=\"flashvars\" value=\""+FLASHVARS+"\" /><param name=\"quality\" value=\""+QUALITY+"\" /><param name=\"menu\" value=\""+MENU+"\" /><param name=\"bgcolor\" value=\""+BGCOLOR+"\" /><param name=\"wmode\" value=\""+TRANSPARENT+"\" /><embed src=\""+FLASHPATH+pathConcat+"section="+section+"&domHeader="+domHeader+"&pcIE="+pcIE+"&MMredirectURL="+escape(MMredirectURL)+"&MMplayerType="+MMplayerType+"&MMdoctitle="+MMdoctitle+"&eos=true\" flashvars=\""+FLASHVARS+"\" quality=\""+QUALITY+"\" menu=\""+MENU+"\" bgcolor=\""+BGCOLOR+"\" width=\""+WIDTH+"\" height=\""+HEIGHT+"\" wmode=\""+TRANSPARENT+"\" name=\""+FLASHPATH+"\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>";
	} else {
		embedVar = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\""+WIDTH+"\" height=\""+HEIGHT+"\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=\""+FLASHPATH+pathConcat+"domHeader="+domHeader+"&section="+section+"&MMredirectURL="+escape(MMredirectURL)+"&MMplayerType="+MMplayerType+"&MMdoctitle="+MMdoctitle+"&pcIE="+pcIE+"&eos=true\" /><param name=\"flashvars\" value=\""+FLASHVARS+"\" /><param name=\"quality\" value=\""+QUALITY+"\" /><param name=\"menu\" value=\""+MENU+"\" /><param name=\"bgcolor\" value=\""+BGCOLOR+"\" /><embed src=\""+FLASHPATH+pathConcat+"section="+section+"&domHeader="+domHeader+"&pcIE="+pcIE+"&MMredirectURL="+escape(MMredirectURL)+"&MMplayerType="+MMplayerType+"&MMdoctitle="+MMdoctitle+"&eos=true\" flashvars=\""+FLASHVARS+"\" quality=\""+QUALITY+"\" menu=\""+MENU+"\" bgcolor=\""+BGCOLOR+"\" width=\""+WIDTH+"\" height=\""+HEIGHT+"\" name=\""+FLASHPATH+"\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>";
	}
	d.write(embedVar);
}
// ***** FLASH EMBED - No codebase for https to use *****
function flashEmbedForHttps(FLASHPATH,WIDTH,HEIGHT,BGCOLOR,QUALITY,MENU,BORDER,TRANSPARENT,FLASHVARS) {
	var hasParams = (FLASHPATH.indexOf("?") != -1)?true:false;
	var pathConcat = "?";
	if (hasParams) {
		pathConcat = "&";
	}
	if ((pcIE && TRANSPARENT != undefined) || swfTransparent) {
		embedVar = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\""+WIDTH+"\" height=\""+HEIGHT+"\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=\""+FLASHPATH+pathConcat+"domHeader="+domHeader+"&section="+section+"&MMredirectURL="+escape(MMredirectURL)+"&MMplayerType="+MMplayerType+"&MMdoctitle="+MMdoctitle+"&pcIE="+pcIE+"&eos=true\" /><param name=\"flashvars\" value=\""+FLASHVARS+"\" /><param name=\"quality\" value=\""+QUALITY+"\" /><param name=\"menu\" value=\""+MENU+"\" /><param name=\"bgcolor\" value=\""+BGCOLOR+"\" /><param name=\"wmode\" value=\""+TRANSPARENT+"\" /><embed src=\""+FLASHPATH+pathConcat+"section="+section+"&domHeader="+domHeader+"&pcIE="+pcIE+"&MMredirectURL="+escape(MMredirectURL)+"&MMplayerType="+MMplayerType+"&MMdoctitle="+MMdoctitle+"&eos=true\" flashvars=\""+FLASHVARS+"\" quality=\""+QUALITY+"\" menu=\""+MENU+"\" bgcolor=\""+BGCOLOR+"\" width=\""+WIDTH+"\" height=\""+HEIGHT+"\" wmode=\""+TRANSPARENT+"\" name=\""+FLASHPATH+"\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" /></object>";
	} else {
		embedVar = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\""+WIDTH+"\" height=\""+HEIGHT+"\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=\""+FLASHPATH+pathConcat+"domHeader="+domHeader+"&section="+section+"&MMredirectURL="+escape(MMredirectURL)+"&MMplayerType="+MMplayerType+"&MMdoctitle="+MMdoctitle+"&pcIE="+pcIE+"&eos=true\" /><param name=\"flashvars\" value=\""+FLASHVARS+"\" /><param name=\"quality\" value=\""+QUALITY+"\" /><param name=\"menu\" value=\""+MENU+"\" /><param name=\"bgcolor\" value=\""+BGCOLOR+"\" /><embed src=\""+FLASHPATH+pathConcat+"section="+section+"&domHeader="+domHeader+"&pcIE="+pcIE+"&MMredirectURL="+escape(MMredirectURL)+"&MMplayerType="+MMplayerType+"&MMdoctitle="+MMdoctitle+"&eos=true\" flashvars=\""+FLASHVARS+"\" quality=\""+QUALITY+"\" menu=\""+MENU+"\" bgcolor=\""+BGCOLOR+"\" width=\""+WIDTH+"\" height=\""+HEIGHT+"\" name=\""+FLASHPATH+"\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" /></object>";
	}
	d.write(embedVar);
}
// ***** Ellen TV Use *****
function transEmbed(FLASHPATH,WIDTH,HEIGHT,BGCOLOR,QUALITY,MENU,BORDER,TRANSPARENT,FLASHVARS) {
	swfTransparent = true;
	flashEmbed(FLASHPATH,WIDTH,HEIGHT,BGCOLOR,QUALITY,MENU,BORDER,TRANSPARENT,FLASHVARS);
}
// ***** IMAGE ROLLOVER & PRELOADER *****
function over(imgName, img_src) {
	d[imgName].src=img_src;
	//document.getElementById(eval(imgName)).src=img_src;
}
function out(imgName, img_src) {
	d[imgName].src=img_src;
	//document.getElementById(eval(imgName)).src=img_src;
}
function preLoadMyImages() {
	arg=preLoadMyImages.arguments;
	imgs=new Array();
	i=imgs.length
	for(i=0; i<arg.length; i++){
		if (arg[i]!=0) {
			imgs[i]=new Image;
			imgs[i].src=arg[i]; //
		}
	}
}
// ***** POPUP WINDOW WITH PARAMETERS *****
function popWin(URL,ID,WIDTH,HEIGHT,RESIZE,SCROLL,MENU,TOOL,LOCATION,DIRECTORIES,STATUS,CENTER) {
	winObject = window.open(URL,ID,'width='+WIDTH+',height='+HEIGHT+',resizable='+RESIZE+',scrollbars='+SCROLL+',menubar='+MENU+',toolbar='+TOOL+',location='+LOCATION+',directories='+DIRECTORIES+',status='+STATUS);
	var clientWidth = screen.availWidth;
	var clientHeight = screen.availHeight;
	var xPos = (clientWidth - WIDTH)/2;
	var yPos = (clientHeight - HEIGHT)/2;
	if (CENTER) {
		winObject.moveTo(xPos,yPos);
	}
}
// ***** POPUP WINDOW WITH PARAMETERS *****
function popupWin(URL,ID,WIDTH,HEIGHT,RESIZE,SCROLL,MENU,TOOL,LOCATION,DIRECTORIES,STATUS) {
	popWin(URL,ID,WIDTH,HEIGHT,RESIZE,SCROLL,MENU,TOOL,LOCATION,DIRECTORIES,STATUS,false);
}
// ***** ARRAY OF QUERY STRINGS *****
var q_array = new Array();
var qp = q.substring(q.indexOf("?")+1, q.length);
q_array = qp.split("&");
for (var q = 0; q<q_array.length; q++) {
	q_array[q] = q_array[q].split("=");
}
function getParamValue(param) {
	for (var p = 0; p<q_array.length; p++) {
		if (param == q_array[p][0]) {
			return q_array[p][1];
			break;
		}
	}
}

function parseGetVars() {
	var getVars = new Array();
	var qString = unescape(this.location.search.substring(1));
	var pairs = qString.split(/\&/);
	for (var i in pairs) {
		var nameVal = pairs[i].split(/\=/);
		getVars[nameVal[0]] = nameVal[1];
	}
	// return getVars;
	return qString;
}

function clearMe(){
	if (isNaN(document.forms[0].place.value)) {
		document.forms[0].place.value = '';
	}
}

function trimEntry(field, max) {
	// if the length of the string in the input field is greater than the max value, trim it
	if (field.value.length > max)
		field.value = field.value.substring(0, max);
}

function checkFlash()
{
    if (playerVersion.major > 8)
    {
        window.location = "./Default.aspx";
    }
}

//**objectwriter.js
// gets around that stupid 'click here to activate this control' crap
function writeFlashObjectEmbed( classID, codebase, objectID, width, height, align, viewastext, allowScriptAccess, movieURL, quality, bgcolor, type, pluginspace, wmode, flashVer)
{
		if (flashVer > 8)
		{
		    if (wmode==null || wmode=="")
		    {
			    wmode = "opaque";
		    }						
		    document.write('<object'); 
		    document.write('	classid="'+classID+'" '); 
		    document.write('	codebase="'+codebase+'" '); 
		    document.write('	width="'+width+'" '); 
		    document.write('	height="'+height+'" '); 
		    document.write('	id="'+objectID+'" '); 
		    document.write('	align="'+align+'" '); 
		    if (viewastext){
			    document.write('	VIEWASTEXT'); 
		    }
		    document.write('>');
		    document.write('	<param name="allowScriptAccess" value="'+allowScriptAccess+'" />'); 
		    document.write('	<param name="movie" value="'+movieURL+'" />'); 
		    document.write('	<param name="quality" value="'+quality+'" />'); 
		    document.write('	<param name="bgcolor" value="'+bgcolor+'" />'); 
		    document.write('	<param name="wmode" value="'+wmode+'" />'); 
		    document.write('		<embed '); 
		    document.write('			src="'+movieURL+'" '); 
		    document.write('			quality="'+quality+'" '); 
		    document.write('			bgcolor="'+bgcolor+'" '); 
		    document.write('			width="'+width+'" '); 
		    document.write('			height="'+height+'" '); 
		    document.write('			name="'+objectID+'" '); 
		    document.write('			align="'+align+'" '); 
		    document.write('			allowScriptAccess="'+allowScriptAccess+'" '); 
		    document.write('			type="'+type+'" ');  
		    document.write('			wmode="'+wmode+'" '); 
		    document.write('			pluginspage="'+pluginspace+'" />'); 
		    document.write('</object>');
		     
		}
		else
		{
		    //document.write('The latest version of Flash Player is required for this site.<br><br><a href=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" target=\"_blank\">Click Here</a> to upgrade to the latest version.<br><br>When Flash Player installation is complete, refresh this page.');
		    //window.location("FlashRequired.aspx");
		    window.location = "./FlashRequired.aspx";
		}

}



/*
 * This file contains functions to generate OBJECT and EMBED tags for QuickTime content. 
 */

/************** LOCALIZABLE GLOBAL VARIABLES ****************/

var gArgCountErr =	'The "%%" function requires an even number of arguments.'
				+	'\nArguments should be in the form "atttributeName", "attributeValue", ...';

/******************** END LOCALIZABLE **********************/

var gTagAttrs				= null;
var gQTGeneratorVersion		= 1.0;

function AC_QuickTimeVersion()	{ return gQTGeneratorVersion; }

function _QTComplain(callingFcnName, errMsg)
{
    errMsg = errMsg.replace("%%", callingFcnName);
	alert(errMsg);
}

function _QTAddAttribute(prefix, slotName, tagName)
{
	var		value;

	value = gTagAttrs[prefix + slotName];
	if ( null == value )
		value = gTagAttrs[slotName];

	if ( null != value )
	{
		if ( 0 == slotName.indexOf(prefix) && (null == tagName) )
			tagName = slotName.substring(prefix.length); 
		if ( null == tagName ) 
			tagName = slotName;
		return tagName + '="' + value + '" ';
	}
	else
		return "";
}

function _QTAddObjectAttr(slotName, tagName)
{
	// don't bother if it is only for the embed tag
	if ( 0 == slotName.indexOf("emb#") )
		return "";

	if ( 0 == slotName.indexOf("obj#") && (null == tagName) )
		tagName = slotName.substring(4); 

	return _QTAddAttribute("obj#", slotName, tagName);
}

function _QTAddEmbedAttr(slotName, tagName)
{
	// don't bother if it is only for the object tag
	if ( 0 == slotName.indexOf("obj#") )
		return "";

	if ( 0 == slotName.indexOf("emb#") && (null == tagName) )
		tagName = slotName.substring(4); 

	return _QTAddAttribute("emb#", slotName, tagName);
}


function _QTAddObjectParam(slotName, generateXHTML)
{
	var		paramValue;
	var		paramStr = "";
	var		endTagChar = (generateXHTML) ? ' />' : '>';

	if ( -1 == slotName.indexOf("emb#") )
	{
		// look for the OBJECT-only param first. if there is none, look for a generic one
		paramValue = gTagAttrs["obj#" + slotName];
		if ( null == paramValue )
			paramValue = gTagAttrs[slotName];

		if ( 0 == slotName.indexOf("obj#") )
			slotName = slotName.substring(4); 
	
		if ( null != paramValue )
			paramStr = '  <param name="' + slotName + '" value="' + paramValue + '"' + endTagChar + '\n';
	}

	return paramStr;
}

function _QTDeleteTagAttrs()
{
	for ( var ndx = 0; ndx < arguments.length; ndx++ )
	{
		var attrName = arguments[ndx];
		delete gTagAttrs[attrName];
		delete gTagAttrs["emb#" + attrName];
		delete gTagAttrs["obj#" + attrName];
	}
}

		

// generate an embed and object tag, return as a string
function _QTGenerate(callingFcnName, generateXHTML, args)
{
	// is the number of optional arguments even?
	if ( args.length < 4 || (0 != (args.length % 2)) )
	{
		_QTComplain(callingFcnName, gArgCountErr);
		return "";
	}
	
	// allocate an array, fill in the required attributes with fixed place params and defaults
	gTagAttrs = new Array();
	gTagAttrs["src"] = args[0];
	gTagAttrs["width"] = args[1];
	gTagAttrs["height"] = args[2];
	gTagAttrs["classid"] = "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";
	gTagAttrs["pluginspage"] = "http://www.apple.com/quicktime/download/";

	// set up codebase attribute with specified or default version before parsing args so
	//  anything passed in will override
	var activexVers = args[3]
	if ( (null == activexVers) || ("" == activexVers) )
		activexVers = "6,0,2,0";
	gTagAttrs["codebase"] = "http://www.apple.com/qtactivex/qtplugin.cab#version=" + activexVers;

	var	attrName,
		attrValue;

	// add all of the optional attributes to the array
	for ( var ndx = 4; ndx < args.length; ndx += 2)
	{
		attrName = args[ndx].toLowerCase();
		attrValue = args[ndx + 1];

		// "name" and "id" should have the same value, the former goes in the embed and the later goes in
		//  the object. use one array slot 
		if ( "name" == attrName || "id" == attrName )
			gTagAttrs["name"] = attrValue;

		else 
			gTagAttrs[attrName] = attrValue;
	}

	// init both tags with the required and "special" attributes
	var objTag =  '<object '
					+ _QTAddObjectAttr("classid")
					+ _QTAddObjectAttr("width")
					+ _QTAddObjectAttr("height")
					+ _QTAddObjectAttr("codebase")
					+ _QTAddObjectAttr("name", "id")
					+ _QTAddObjectAttr("tabindex")
					+ _QTAddObjectAttr("hspace")
					+ _QTAddObjectAttr("vspace")
					+ _QTAddObjectAttr("border")
					+ _QTAddObjectAttr("align")
					+ _QTAddObjectAttr("class")
					+ _QTAddObjectAttr("title")
					+ _QTAddObjectAttr("accesskey")
					+ _QTAddObjectAttr("noexternaldata")
					+ '>\n'
					+ _QTAddObjectParam("src", generateXHTML);
	var embedTag = '  <embed '
					+ _QTAddEmbedAttr("src")
					+ _QTAddEmbedAttr("width")
					+ _QTAddEmbedAttr("height")
					+ _QTAddEmbedAttr("pluginspage")
					+ _QTAddEmbedAttr("name")
					+ _QTAddEmbedAttr("align")
					+ _QTAddEmbedAttr("tabindex");

	// delete the attributes/params we have already added
	_QTDeleteTagAttrs("src","width","height","pluginspage","classid","codebase","name","tabindex",
					"hspace","vspace","border","align","noexternaldata","class","title","accesskey");

	// and finally, add all of the remaining attributes to the embed and object
	for ( var attrName in gTagAttrs )
	{
		attrValue = gTagAttrs[attrName];
		if ( null != attrValue )
		{
			embedTag += _QTAddEmbedAttr(attrName);
			objTag += _QTAddObjectParam(attrName, generateXHTML);
		}
	} 

	// end both tags, we're done
	return objTag + embedTag + '> </em' + 'bed>\n</ob' + 'ject' + '>';
}

// return the object/embed as a string
function QT_GenerateOBJECTText()
{
	return _QTGenerate("QT_GenerateOBJECTText", false, arguments);
}

function QT_GenerateOBJECTText_XHTML()
{
	return _QTGenerate("QT_GenerateOBJECTText_XHTML", true, arguments);
}

function QT_WriteOBJECT()
{
	document.writeln(_QTGenerate("QT_WriteOBJECT", false, arguments));
}

function QT_WriteOBJECT_XHTML()
{
	document.writeln(_QTGenerate("QT_WriteOBJECT_XHTML", true, arguments));
}

//Get cookie routine by Shelley Powers 
function get_cookie(Name) 
{
    var search = Name + "="
    var returnvalue = "";
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(search)
        // if cookie exists
        if (offset != -1) { 
            offset += search.length
            // set index of beginning of value
            end = document.cookie.indexOf(";", offset);
            // set index of end of cookie value
            if (end == -1) end = document.cookie.length;
            returnvalue=unescape(document.cookie.substring(offset, end))
        }
    }
    return returnvalue;
}

// show SMS Opt-in Checkbox

function showSMSOpt() {
if ($("#ddlPHONENUMBERTYPE").val() == 'MOBILE') {
$('#smsOpt').show();
} else {
$('#smsOpt').hide();
}

}
