﻿
var TCP = new TColorPicker();
 document.onkeyup = alertkey;
function TCPopup( field , palette , field1 , field2 , field3,field4,val  ) {

	this.field = field;
	this.field1 = field1;
	this.field2 = field2;
	this.field3 = field3;
	this.field4 = field4;
	this.val=val;
	
	this.initPalette = !palette || palette > 3 ? 0 : palette;
	var w = 194, h = 240,
	move = screen ? 
		',left=' + ((screen.width - w) >> 1) + ',top=' + ((screen.height - h) >> 1) : '', 
	o_colWindow = window.open('../popupwindow/picker.html', 'COLOR', "help=no,status=no,scrollbars=no,resizable=no,toolbar=no" + move + ",width=" + w + ",height=" + h + ",dependent=yes", true);
	o_colWindow.opener = window;
	o_colWindow.focus();
}

function TCBuildCell (R, G, B, w, h) {
	return '<td bgcolor="#' + this.dec2hex((R << 16) + (G << 8) + B) + '"><a href="javascript:P.S(\'' + this.dec2hex((R << 16) + (G << 8) + B) + '\')" onmouseover="P.P(\'' + this.dec2hex((R << 16) + (G << 8) + B) + '\')"><img src="pixel.gif" width="' + w + '" height="' + h + '" border="0"></a></td>' ;
}

function TCSelect(c) {
	this.field.value = '#' + c.toUpperCase();
	if(this.val==1)
	{
	    this.field.style.backgroundColor= '#' + c.toUpperCase();
	    this.field1.style.backgroundColor= '#' + c.toUpperCase();
	    this.field2.style.backgroundColor= '#' + c.toUpperCase();
	    this.field3.style.backgroundColor= '#' + c.toUpperCase();
	    this.field4.value= '#' + c.toUpperCase();
    }
    else if(this.val==0)
    {
        this.field.style.color= '#' + c.toUpperCase();
	    this.field1.style.color= '#' + c.toUpperCase();
	    this.field2.style.color= '#' + c.toUpperCase();
	    this.field3.style.color= '#' + c.toUpperCase();
	    this.field4.value= '#' + c.toUpperCase();
    }
	
	//this.field1.setAttribute("Background-color",'#' + c.toUpperCase(),false);
	//alert(this.field1.style.backgroundColor);		
	this.win.close();
}

function TCPaint(c, b_noPref) {
    //alert(this.sample.backgroundColor);
	c = (b_noPref ? '' : '#') + c.toUpperCase();
	if (this.o_samp) 
		this.o_samp.innerHTML = '<font face=Tahoma size=2>' + c +' <font color=white>' + c + '</font></font>'
	if(this.doc.layers)
		this.sample.bgColor = c;
	else { 
		//if (this.sample.backgroundColor != null) this.sample.backgroundColor = c;
		//else if (this.sample.background != null) this.sample.background = c;
	}
}

function TCGenerateSafe() {
	var s = '';
	for (j = 0; j < 12; j ++) {
		s += "<tr>";
		for (k = 0; k < 3; k ++)
			for (i = 0; i <= 5; i ++)
				s += this.bldCell(k * 51 + (j % 2) * 51 * 3, Math.floor(j / 2) * 51, i * 51, 8, 10);
		s += "</tr>";
	}
	return s;
}

function TCGenerateWind() {
	var s = '';
	for (j = 0; j < 12; j ++) {
		s += "<tr>";
		for (k = 0; k < 3; k ++)
			for (i = 0; i <= 5; i++)
				s += this.bldCell(i * 51, k * 51 + (j % 2) * 51 * 3, Math.floor(j / 2) * 51, 8, 10);
		s += "</tr>";
	}
	return s	
}
function TCGenerateMac() {
	var s = '';
	var c = 0,n = 1;
	var r,g,b;
	for (j = 0; j < 15; j ++) {
		s += "<tr>";
		for (k = 0; k < 3; k ++)
			for (i = 0; i <= 5; i++){
				if(j<12){
				s += this.bldCell( 255-(Math.floor(j / 2) * 51), 255-(k * 51 + (j % 2) * 51 * 3),255-(i * 51), 8, 10);
				}else{
					if(n<=14){
						r = 255-(n * 17);
						g=b=0;
					}else if(n>14 && n<=28){
						g = 255-((n-14) * 17);
						r=b=0;
					}else if(n>28 && n<=42){
						b = 255-((n-28) * 17);
						r=g=0;
					}else{
						r=g=b=255-((n-42) * 17);
					}
					s += this.bldCell( r, g,b, 8, 10);
					n++;
				}
			}
		s += "</tr>";
	}
	return s;
}

function TCGenerateGray() {
	var s = '';
	for (j = 0; j <= 15; j ++) {
		s += "<tr>";
		for (k = 0; k <= 15; k ++) {
			g = Math.floor((k + j * 16) % 256);
			s += this.bldCell(g, g, g, 9, 7);
		}
		s += '</tr>';
	}
	return s
}

function TCDec2Hex(v) {
	v = v.toString(16);
	for(; v.length < 6; v = '0' + v);
	return v;
}

function TCChgMode(v) {
	for (var k in this.divs) this.hide(k);
	this.show(v);
}

function TColorPicker( field , field1 , field2 , field3 ,field4, val  ) {
	this.build0 = TCGenerateSafe;
	this.build1 = TCGenerateWind;
	this.build2 = TCGenerateGray;
	this.build3 = TCGenerateMac;
	this.show = document.layers ? 
		function (div) { this.divs[div].visibility = 'show' } :
		function (div) { this.divs[div].visibility = 'visible' };
	this.hide = document.layers ? 
		function (div) { this.divs[div].visibility = 'hide' } :
		function (div) { this.divs[div].visibility = 'hidden' };
	// event handlers
	this.C       = TCChgMode;
	this.S       = TCSelect;
	this.P       = TCPaint;
	this.popup   = TCPopup;
	this.draw    = TCDraw;
	this.dec2hex = TCDec2Hex;
	this.bldCell = TCBuildCell;
	this.divs = [];
}

function TCDraw(o_win, o_doc) {
	this.win = o_win;
	this.doc = o_doc;
		
	var 
	s_tag_openT  = o_doc.layers ? 
		'layer visibility=hidden top=54 left=5 width=182' : 
		'div style=visibility:hidden;position:absolute;left:6px;top:54px;width:182px;height:0',
	s_tag_openS  = o_doc.layers ? 'layer top=32 left=6' : 'div',
	s_tag_close  = o_doc.layers ? 'layer' : 'div'
		
	this.doc.write('<' + s_tag_openS + ' id=sam name=sam><table cellpadding=0 cellspacing=0 border=1 width=181 align=center class=bd><tr><td align=center height=18><div id="samp"><font face=Tahoma size=2>sample <font color=white>sample</font></font></div></td></tr></table></' + s_tag_close + '>');
	this.sample = o_doc.layers ? o_doc.layers['sam'] : 
		o_doc.getElementById ? o_doc.getElementById('sam').style : o_doc.all['sam'].style

	for (var k = 0; k < 4; k ++) {
		this.doc.write('<' + s_tag_openT + ' id="p' + k + '" name="p' + k + '"><table cellpadding=0 cellspacing=1 border=0 align=center>' + this['build' + k]() + '</table></' + s_tag_close + '>');
		this.divs[k] = o_doc.layers 
			? o_doc.layers['p' + k] : o_doc.all 
				? o_doc.all['p' + k].style : o_doc.getElementById('p' + k).style
	}
	if (!o_doc.layers && o_doc.body.innerHTML) 
		this.o_samp = o_doc.all 
			? o_doc.all.samp : o_doc.getElementById('samp');
	this.C(this.initPalette);
	
	if (this.field.value) 
		this.P(this.field.value, true)	
}
function CallPrint(Control)
    {        
        var PrintValue = document.getElementById(Control).innerHTML;
        var WinPrint = window.open('','','left=' + screen.width  + ',top=' + screen.height + ',width=1,height=1,toolbar=0,scrollbars=0,status=0');        
        //var WinPrint=window.open('','popup','width=500,height=600,top=150,left=150,toolbar=0,scrollbars=0,status=0');
        WinPrint.document.write(PrintValue);
        WinPrint.document.close();
        WinPrint.focus();
        WinPrint.print();
        WinPrint.close();
        return false;
    }

function GetNextFileDetails()
{   
    var p = new Pause(PlayFileDelayTime, showme);
    var list=document.getElementById(lstFileListClientID);
    
    intNextValue=document.getElementById(hdnNextFileNoClientID).value;
    intNextValue=parseInt(intNextValue);           
    
    intNextFileNo=intNextValue+1;
    GetFileDetails(intNextValue);
}

function GetFileDetails(intNextValue)
{   
   
        var list=document.getElementById(lstFileListClientID);
        var intTemp=GetNoOfSelectedValue(lstFileListClientID);
       
        if(intSelectedItemCount>1)
        {   
            document.getElementById(dvVideoClientID).style.display='';
            document.getElementById(hdnNextFileNoClientID).value=intNextValue;
            var fDet=document.getElementById(strFileDetailsClientID).value.split('^');
            var fImgDet=document.getElementById(strImageFileDetailsClientID).value.split('^');
            var fAltTagDet=document.getElementById(strFileAltDetailsClientID).value.split('^');
           
            var i;
           
            for(i = intNextValue; i <= intNextValue; i++)
            {     
                //alert(fImgDet[i]);
                if(fImgDet[i]!='' )                
                    document.getElementById(imgFileImageClientID).src=fImgDet[i];                                    
                else               
                    document.getElementById(imgFileImageClientID).src='../app_themes/childfont/images/messageboard.gif';                                    
                /*Inserted by Astha Shah on 04 Jun 2008 Phase 4 Changes
                if(fDet[i]!='')
                    document.getElementById(txtFileTextClientID).value=fDet[i];
                Complete*/
                if(fAltTagDet[i]!='')
                    ChangeAltTagImage(fAltTagDet[i]);
            }
        }        
        else
        {   
            document.getElementById(dvLiteralVideoClientID).style.display='';            
            if(document.getElementById(dvLiteralVideoClientID).style.display=='')
                document.getElementById(dvVideoClientID).style.display='none';
        }
        if(intNextValue>=intSelectedItemCount)
        {
            document.getElementById(imgFileImageClientID).src='../app_themes/childfont/images/messageboard.gif';
            document.getElementById(txtFileTextClientID).value='';
            intSelectedItemCount=0;
        }
   
}
function ChangeAltTagImage(val)
{   
//    alert(val);
    document.getElementById(imgFileImageClientID).onMouseOver=AssignAltTagValue(val);
}
function AssignAltTagValue(val)
{
    document.getElementById(imgFileImageClientID).alt=val;
    //document.getElementById(imgFileImageClientID).AlternateText=val;
}
function CanImagePrint(control,type)
{   
  

    if(type!='visitor')
    {
        if (confirm(strDefaultImage)) 
        {  
            CallPrint(control);
        }
        else
        {
            return false;
        }  
    }
    else
    {
        alert('In order to use this functionality you need to sign up and purchase a Child Font curriculum package.');
        return false;
    }
}
function SetOriginalValues()
{
    var intTemp=GetNoOfSelectedValue(lstFileListClientID);
    document.getElementById(imgFileImageClientID).src='../app_themes/childfont/images/messageboard.gif';
    document.getElementById(txtFileTextClientID).value='';
    intSelectedItemCount=0;
}
function CheckFileSelectedForWhiteBoard(control,lbl,msg,txt)
{
   
    var val=document.getElementById(control).length;
    var txtval=document.getElementById(txt);
    var intTemp=GetNoOfSelectedValue(lstFileListClientID);
    if(val>0)
    {   
        
        if(intSelectedItemCount==1)
        {
              
            document.getElementById(hdnIsFileSelected).value='1';   
            return true;
        }
        else if(intSelectedItemCount==0)
        {
            document.getElementById(hdnIsFileSelected).value='0';            
            alert('Please Select File(s)');
            return false;
        }
        else
        {
            document.getElementById(hdnIsFileSelected).value='0';            
            alert(strSelectOnlyOneFile);
            return false;
        }
        
    }
    else if((txtval != '') &&(intDocID!=0))
    {
         document.getElementById(hdnIsFileSelected).value='1';   
            return true;
    }
    else
    {      
       
        document.getElementById(hdnIsFileSelected).value='0';
        alert(strFileIsNotAvailable);
        return false;
    }
}
function CheckFileSelected(control,lbl,msg)
{       
    var val=document.getElementById(control).length;
    
    if(val>0)
    {       
        //var intTemp=GetNoOfSelectedValue(lstFileListClientID);
        var intTemp=GetNoOfSelectedValue(control);
        
        if(intSelectedItemCount>0)
        {              
            document.getElementById(hdnIsFileSelected).value='1';   
            return true;
        }
        else
        {
            document.getElementById(hdnIsFileSelected).value='0';            
            alert(strSelectFile);
            return false;
        }
        
    }
    else
    {      
        document.getElementById(hdnIsFileSelected).value='0';
        alert(strFileIsNotAvailable);
        return false;
    }
    
}
function CheckLengthOfFileText()
{
    var val = document.getElementById(txtFileTextClientID).value;
    var len=val.length;    
    if(len<=10)
    {
        return true;
    }
    else
    {
        return confirm('WB does not support the entire story; some of the words would be missing on whiteboard. You may use the Print option available for a complete print out of the story in Child Font characters. Do you still want to Continue?');
    }
}
function SetControlColor(lst,ddl1,ddl2,txt,bgval,txtval)
{
    
    if(bgval!="#ffffff")
    {
        document.getElementById(lst).style.backgroundColor=bgval;
        document.getElementById(ddl1).style.backgroundColor=bgval;
        document.getElementById(ddl2).style.backgroundColor=bgval;
        document.getElementById(txt).style.backgroundColor=bgval;
    }
    else
    {
        bgval="#ffffff";
        document.getElementById(lst).style.backgroundColor=bgval;
        document.getElementById(ddl1).style.backgroundColor=bgval;
        document.getElementById(ddl2).style.backgroundColor=bgval;
        document.getElementById(txt).style.backgroundColor=bgval;
    }   
    if(txtval !="#000000")
    {
        document.getElementById(lst).style.color=txtval;
        document.getElementById(ddl1).style.color=txtval;
        document.getElementById(ddl2).style.color=txtval;
        document.getElementById(txt).style.color=txtval;
    }
    else
    {
        txtval="#000000";
        document.getElementById(lst).style.color=txtval;
        document.getElementById(ddl1).style.color=txtval;
        document.getElementById(ddl2).style.color=txtval;
        document.getElementById(txt).style.color=txtval;
    }
    
}
function CheckSelectedFontSize(rbtn,msg)
{   
    var rdolist = document.getElementById(rbtn).id;   
    if(!checkSelection(rdolist,msg))
    {
        document.getElementById(rdolist+"_0").checked=true;
    }
   
} 
function checkSelection(rdolist,msg)
{    
    if (document.getElementById(rdolist+"_1").checked)					
    {
        return confirm(msg);            
    }
    if (document.getElementById(rdolist+"_2").checked)					
    {        
        return confirm(msg);        
    }
    return false;
}
function TakeTextPrint(pageURL,rbtn1,rbtn2,txt,intfontsize)
{    
    var intFontStyle=this.GetFontStyleForPrint(rbtn1);
    var intFontSizeForPrint=this.GetFontSizeForPrint(rbtn2);
    var txtVal=document.getElementById(txt).value; 
    document.getElementById(txt).style.fontSize=intfontsize+"px";    
   
    if(txtVal!='')
    {
       window.open("../popupwindow/PrintStudyAreaText.aspx?FileText=" + txtVal + '&FontSize=' + intFontSizeForPrint + '&FontStyle=' + intFontStyle,'','left=' + screen.width  + ',top=' + screen.height + ',width=1,height=1,toolbar=0,scrollbars=0,status=0');        
       
    }
    else
    {
        alert('Curriculum Text Is Not Exists.');return false;
        
    }
    return false;
    
}

function TakeWhiteBoardTextPrint(pageURL,rbtn1,rbtn2,txt,intfontsize)
{    
    
    var intFontStyle=this.GetFontStyleForPrint(rbtn1);
    var intFontSizeForPrint=this.GetFontSizeForPrint(rbtn2);
    //var txtVal=document.getElementById(txt).value; 
    var txtVal=txt; 
    //document.getElementById(txt).style.fontSize=intfontsize+"px";    
   
    if(txtVal!='')
    {
        
       window.open("../popupwindow/PrintStudyAreaText.aspx?FileText=" + txtVal + '&FontSize=' + intFontSizeForPrint + '&FontStyle=' + intFontStyle,'','left=' + screen.width  + ',top=' + screen.height + ',width=1,height=1,toolbar=0,scrollbars=0,status=0');        
       
    }
    else
    {
        alert('Curriculum Text Is Not Exists.');return false;
        
    }
    return false;
    
}

function GetFontStyleForPrint(rbtn1)
{
     var rdolist = document.getElementById(rbtn1).id;
     if(document.getElementById(rdolist+"_0").checked)
        return 0;
     else if(document.getElementById(rdolist+"_1").checked)
        return 1;
     else 
        return 1;
}
function GetFontSizeForPrint(rbtn2)
{
    var rdolist = document.getElementById(rbtn2).id;
     if(document.getElementById(rdolist+"_0").checked)
        return document.getElementById(rdolist+"_0").value;
     else if(document.getElementById(rdolist+"_1").checked)
        return document.getElementById(rdolist+"_1").value;
     else if(document.getElementById(rdolist+"_2").checked)
        return document.getElementById(rdolist+"_2").value;
     else 
        return document.getElementById(rdolist+"_0").value;
}

function GetNoOfSelectedValue(lst)
{  
    intSelectedItemCount=0;
    var objSelect = document.getElementById(lst);    
    var numOptions =objSelect.options.length;
    for (var i = 0; i < numOptions; i++)
    {
        if(objSelect.options[i].selected)
        {
            intSelectedItemCount = intSelectedItemCount + 1;
        }
    }
    
    return intSelectedItemCount;
}

function hidePanel(pnl,ddl)
{
    
    var ddl1=document.getElementById(ddl);
    var index=ddl1.selectedIndex;
    
    if(index!=0)
    {   
        alert(pnl);
        if((document.getElementById(pnl).style.display!='none')||(document.getElementById(pnl)!='undefined'))
            document.getElementById(pnl).style.display='none';
    }
    else
    {
        alert(pnl);
        if((document.getElementById(pnl).style.display!='none')||(document.getElementById(pnl)!='undefined'))
            document.getElementById(pnl).style.display='';
        else
            document.getElementById(pnl).style.display='none';
    }
}
function ChangeParentFontSize(txt,ddl)
{   
    
    var ddl1=document.getElementById(ddl);
    var index=ddl1.selectedIndex;   
    //var index=ddl1.options.selcetedIndex;
    
    if(index!=0)
    {   
        document.getElementById(txt).style.fontSize=parseInt(ddl1.options[index].text)+ "px";
    }
    else
    {   
        document.getElementById(txt).style.fontSize='10' +"px";
    }
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function EvImageOverChange(name, direction,id)
    {
       
        if(id==1)
        {
            switch(direction)
            {
                case 'in':
                    name.src = "../app_themes/childfont/images/wb2.gif";
                    
                    break;
                case 'out':
                    name.src = "../app_themes/childfont/images/wb1.gif";
                    break;
            }
        }  
        else if(id==2)
        {
            switch(direction)
            {
                case 'in':
                    name.src = "../app_themes/childfont/images/doc2.gif";
                    break;
                case 'out':
                    name.src = "../app_themes/childfont/images/doc1.gif";
                    break;
            }
        } 
        else if(id==3)
        {
            switch(direction)
            {
                case 'in':
                    name.src = "../app_themes/childfont/images/help2.gif";
                    break;
                case 'out':
                    name.src = "../app_themes/childfont/images/help1.gif";
                    break;
            }
        } 
        else if(id==4)
        {
            switch(direction)
            {
                case 'in':
                    name.src = "../app_themes/childfont/images/home1s_over.gif";
                    break;
                case 'out':
                    name.src = "../app_themes/childfont/images/home1s.gif";
                    break;
            }
        } 
         else if(id==5)
        {
            switch(direction)
            {
                case 'in':
                    name.src = "../HelpFiles/LtoMsG3.jpg";
                    break;
                case 'out':
                    name.src = "../HelpFiles/LtoMsG3.jpg";
                    break;
            }
        } 
    }
   function Pause(duration, busy)
   {
      this.duration= duration * 1000;
      this.busywork = null; // function to call while waiting.
      this.runner = 0;

      if (arguments.length == 2) 
      {
         this.busywork = busy;
      }

      this.pause(this.duration);

   } // Pause class

   /** pause method 
   
       @param duration: integer in seconds
       
    */
   Pause.prototype.pause = function(duration)
   {
      if ( (duration == null) || (duration < 0)) {return;}

      var later = (new Date()).getTime() + duration;

      while(true)
      {
         if ((new Date()).getTime() > later) 
         {
            break;
         }

         this.runner++;

         if (this.busywork != null) 
         {
            this.busywork(this.runner);
         }

      } // while

   } // pause method

 function showme(progIndex)
 {
        //window.status= "progress: " + progIndex;
    }
    
    
charCount = 1;
//maxCharCount = maxVal;

function displayRemLength() {
	remField = document.getElementById(lblMaxLengthClientID);
	remField.innerHTML = (maxVal - charCount > 0) ? maxVal - charCount : 0;
}

function evalEntryLength(curField,  discardXtra, errClass, normalClass) {
	//maxCharCount = maxLimit;
	maxCharCount = maxVal;
	maxLimit=maxVal;
	var fieldLength = getCharCount(curField);
	
	if (fieldLength > maxLimit) {
		if (errClass != "") {
			curField.className = errClass;
		}
		if (discardXtra) {
			showAllowedLength(curField, maxLimit);
		}
	} else if (normalClass != "") {
		curField.className = normalClass;
	}
}

function getCharCount(curField) {
	charCount = curField.value.length;
	
	return charCount;
}

function showAllowedLength(curField, maxLimit) {
	curField.value = curField.value.substr(0, maxLimit);
	window.status = curField.value;
}

function doHandleEnterKeyStroke(frm,e)
{
    if(document.captureEvents && e.KEYUP)
    {
        document.captureEvents( e.KEYUP );
    }
   
}
function alertkey(e) {
  if( !e ) {
    //if the browser did not pass the event information to the
    //function, we will have to obtain it from the event register
    if( window.event ) {
      //Internet Explorer
      e = window.event;
    } else {
      //total failure, we have no way of referencing the event
      return;
    }
  }
  if( typeof( e.keyCode ) == 'number'  ) {
    //DOM
    e = e.keyCode;
  } else if( typeof( e.which ) == 'number' ) {
    //NS 4 compatible
    e = e.which;
  } else if( typeof( e.charCode ) == 'number'  ) {
    //also NS 6+, Mozilla 0.9+
    e = e.charCode;
  } else {
    //total failure, we have no way of obtaining the key code
    return;
  }
//  window.alert('The key pressed has keycode ' + e +
//    ' and is key ' + String.fromCharCode( e ) );
}




//Disabled TextBox

//function DisableSelect()
//{

//<!--

////Disable right click script III- By Renigade (renigade@mediaone.net)
////For full source code, visit http://www.dynamicdrive.com
//var message="";
/////////////////////////////////////
//function clickIE() {if (document.all) {(message);return false;}}
//function clickNS(e) {if 
//(document.layers||(document.getElementById&&!document.all)) {
//if (e.which==2||e.which==3) {(message);return false;}}}
//if (document.layers) 
//{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
//else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

//document.oncontextmenu=new Function('return false')
//// --> 

////document.DisableSelect() = true;

//document.ondragstart = new Function('return false');
//document.onselectstart=new Function('return false');
//function dMDown(e) {return false;}
//function dOClick() {return true;}
//document.onmousedown=dMDown;
//document.onclick=dOClick;

//}

//function disableControlKey(e)
//{
//        var forbiddenKeys = new Array('a', 'n', 'c', 'x', 'v', 'j');
//        var key;        
//        var isCtrl;

//        if(window.event)
//        {
//                key = window.event.keyCode;     //IE
//                if(window.event.ctrlKey)
//                        isCtrl = true;
//                else
//                        isCtrl = false;
//        }
//        else
//        {
//               
//                key = e.which;     //firefox                
//                if(e.ctrlKey)
//                        isCtrl = true;                                                
//                else
//                        isCtrl = false;
//        }
//        //if ctrl is pressed check if other key is in forbidenKeys array
//        if(isCtrl)
//        {            
//              if(key == 97)
//              {               
//               return false;
//              }
//              else if(key == 99)
//              {              
//              return false;
//              }
//              else if(key == 120)
//              {
//                return false;
//              }                                            
//        }
//        return false;

//}

//function enabledControlKey(e)
//{
//        var forbiddenKeys = new Array('a', 'n', 'c', 'x', 'v', 'j');
//        var key;        
//        var isCtrl;

//        if(window.event)
//        {
//                key = window.event.keyCode;     //IE
//                if(window.event.ctrlKey)
//                        isCtrl = true;
//                else
//                        isCtrl = true;
//        }
//        else
//        {
//               
//                key = e.which;     //firefox                
//                if(e.ctrlKey)
//                        isCtrl = true;                                                
//                else
//                        isCtrl = true;
//        }
//        //if ctrl is pressed check if other key is in forbidenKeys array
//        if(isCtrl)
//        {            
//              if(key == 97)
//              {               
//               return true;
//              }
//              else if(key == 99)
//              {              
//              return true;
//              }
//              else if(key == 120)
//              {
//                return true;
//              }                                            
//        }
//        return true;

//}


//document.onkeypress = disableControlKey;

function evalWhiteBoardEntryLength(curField,  discardXtra, errClass, normalClass)
{
    //maxCharCount = maxLimit;
	maxCharCount = maxValofWhiteBoardText;
	maxLimit=maxValofWhiteBoardText;
	var fieldLength = getCharCount(curField);
	
	if (fieldLength > maxLimit) {
		if (errClass != "") {
			curField.className = errClass;
		}
		if (discardXtra) {
			showAllowedLength(curField, maxLimit);
		}
	} else if (normalClass != "") {
		curField.className = normalClass;
	}
}

function displayWhiteBoardRemLength() {
	remField = document.getElementById(lblWhiteBoardLengthClientID);
	remField.innerHTML = (maxValofWhiteBoardText - charCount > 0) ? maxValofWhiteBoardText - charCount : 0;
}

function doHandleEnterWhiteBoardKeyStroke(frm,e)
{
     if(document.captureEvents && e.KEYUP)
    {
        document.captureEvents( e.KEYUP );
    }
}


function TakeAdditionalDetailsPrint(pageURL,rbtn)
{    
   
    var strURL=this.GetAdditionalURL(rbtn);
     
   
    if(strURL!='')
    {
       //window.open("../popupwindow/PrintAdditionalCurriculumDetails.aspx?Data=" + txtVal ,'','left=' + screen.width  + ',top=' + screen.height + ',width=1,height=1,toolbar=0,scrollbars=0,status=0');        
       window.open("../popupwindow/PrintAdditionalCurriculumDetails.aspx?Data=" + strURL ,'','left=' + screen.width  + ',top=' + screen.height + ',width=1,height=1,toolbar=0,scrollbars=0,status=0');        
       
    }
    else
    {
        alert('Additional Curriculum Details Not Available.');return false;
        
    }
    return false;
    
}

function GetAdditionalURL(rbtn)
{
    alert('hi');
     var rdolist = document.getElementById(rbtn).id;
     if(document.getElementById(rdolist+"_0").checked)
     {
        if(strPS1URL != '')
        {
            return strPS1URL;
        }
        else
        {
            return '';
        }
        
     }
     else if(document.getElementById(rdolist+"_1").checked)
     {
        if(strPS2URL != '')
        {
            return strPS2URL;
        }
        else
        {
            return '';
        }
     }
     else 
        return '';
}