<!--
function $(id){ return document.getElementById(id); }

function StringTrim(dataString){
    dataString = dataString.replace(/\s*((\S+\s*)*)/, "$1"); // Ltrim
    dataString = dataString.replace(/((\s*\S+)*)\s*/, "$1"); // Rtrim
    return dataString;
}
function stripHTML(){
    var re= /<\S[^><]*>/g;
    for (i=0; i<arguments.length; i++)
        arguments[i].value = arguments[i].value.replace(re, "")
}

function RamdomString(intLen){
	var strRet = "";
	var iCntr  = 0;
	var rndNo  = 0;
	var arrCharacters = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z");
	for (iCntr = 0; iCntr < intLen; iCntr++){
		rndNo = Math.floor((61 - 1 + 1) * Math.random() + 1);
		strRet = strRet + arrCharacters[rndNo];
	}
	return strRet;
}

function SelectAll(frmObj){
    totalRec = 0;
    if(typeof frmObj != "object"){ frmObj = $(frmObj); }

    var input = frmObj.getElementsByTagName("input");
	for(i = 0; i < input.length; i++){	  
		if (input[i].type == "checkbox"){
			input[i].checked = true;
			totalRec += 1;
		}
	}
	$('spanSelected').innerHTML = totalRec;
}

function UnselectAll(frmObj){
	if(typeof frmObj != "object"){ frmObj = $(frmObj); }
	
    var input = frmObj.getElementsByTagName("input");
	for(i = 0; i < input.length; i++){
		if (input[i].type == "checkbox"){
			input[i].checked = false;
		}
	}
	$('spanSelected').innerHTML = "0";
}

function CalculateTotal(frmObj){
    totalRec = 0;
    if(typeof frmObj != "object"){ frmObj = $(frmObj); }

    var input = frmObj.getElementsByTagName("input");
	for(i = 0; i < input.length; i++){	  
		if (input[i].type == "checkbox" && input[i].checked == true){
			totalRec += 1;
		}
	}
	$('spanSelected').innerHTML = totalRec;
}

function SelectionCheck(frmObj, hdnField){
    if(typeof frmObj != "object"){ frmObj = $(frmObj); }
    var input = frmObj.getElementsByTagName("input");
    
    var action = $('ctl00_ContentPlaceHolder1_ddlActions');
    if(action != null){
        if(action.value == ""){
            alert('-- Please select your action');
            return false;
        }
    }
	var flag = 0;
	var strid = "0";
	for(i = 0; i < input.length; i++){
		if (input[i].type == "checkbox"){
			if (input[i].checked){
				if (flag == 0){ flag = 1; }
				if(input[i].name != ""){ strid = strid + "#" + input[i].name; }
		    }
		}
	}
    strid = strid.substring(2);
	if(flag == 1){
	    if(hdnField){ $(obj).value = strid; }
	    else{ 
	        if($('hdnID') != null){ $('hdnID').value = strid; }
		}
        if(action != null){
		    if(action.value == "Delete")
			    return confirm("-- Are you sure you want to delete selected records?");
	    }
	    else
	        return true;
	}
	else{
	    if(action != null){
	        if(action.value == "o"){ return true; } }
		    alert("-- Please select at least one record from list.");
		return false;
	}
}

function getEditor(objName, width, height, mode){
    if(width == null)
        width = "400";
    if(height == null)
        height = "200";
    if(mode == null)
        mode = "advanced";
        
    tinyMCE.init({
        mode : "exact",             //mode can be "exact" i.e. Converts only specific elements seperated by comma("txtcontent1,txtcontent2,.."), OR "textareas" i.e. Converts all textarea elements to editors.
        elements : objName,         // name of the taxtarea,which is to be used for HTML Editor, for mode : "exact" only.
        theme : mode,               // mode can be, 'simple' or 'advanced'.
        //below code is for advanced mode only
        //content_css : "style.css", // path of the style sheet.
        width : width,              //width of HTML Editor.
        height : height,            //height of HTML Editor.
        plugins : "table,advhr,advimage,advlink,emotions,iespell,insertdatetime,flash,searchreplace,contextmenu",
        theme_advanced_buttons1_add : "fontselect,fontsizeselect",
        theme_advanced_buttons2_add : "separator,insertdate,inserttime,separator,forecolor,backcolor",
        theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
        theme_advanced_buttons3_add_before : "tablecontrols,separator",
        theme_advanced_buttons3_add : "emotions,iespell,flash",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "center",
        theme_advanced_path_location : "bottom",
        plugin_insertdate_dateFormat : "%m/%d/%Y",
        plugin_insertdate_timeFormat : "%H:%M:%S",
        relative_urls : true,       //false=abs path relative to root dir, true=path relative to root dir
        extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
        external_link_list_url : "example_data/example_link_list.js",
        external_image_list_url : "example_data/example_image_list.js",
        flash_external_list_url : "example_data/example_flash_list.js",
        file_browser_callback : "fileBrowserCallBack"
        //above code is for advanced mode only
       });
}
function fileBrowserCallBack(field_name, url, type){ }
//-->