var divArray=new Array("generalSetting", "generalMember", "generalLanguage", "generalMenu", "generalAnnouncement", "generalLogin", "generalList", "generalManageBugs", "generalPlugin");
var session_check = 'heck|||||||||valid|||||||||login';
var session_check_replace = 'check|||||||||valid|||||||||login';
var module_name_js ='';
//onfocus, onblur, issues fixed
var form_name_array = new Array();
if(!block_arr)
{
	var block_arr = new Array();
}
var ajaxWindowLink;
var ajaxWindowYPos = 0;
var ajaxWindowXPos = 0;
var allowChannelHide = true;
var channelDivSet = false;
var allowMenuMoreHide = true;
var menuMoreDivSet = false;
var allowHeaderSearchHide = true;
var headerSearchDivSet = false;
var allowFooterSearchHide = true;
var footerSearchDivSet = false;

//function for check box manage
function CheckAll(form_name,check_all,isO,noHL)
	{
		var trk=0;
		var frm = eval('document.'+form_name);
		var check_frm = eval('document.'+form_name+'.'+check_all);

		for (var i=0;i<frm.elements.length;i++)
		{
			var e=frm.elements[i];
			if ((e.name != check_all) && (e.type=='checkbox'))
			{
				if (isO != 1)
				{
					trk++;
					if(e.disabled!=true)
						e.checked=check_frm.checked;
				}
			}
		}
	}

/* scrolling the div start*/
var scrollObj;
function scroll(){
	this.speed=2;
	this.contentHeightToScroll = 100;
	this.disabled_class = 'clsDisabled';
}
scroll.prototype.changeContentHeight = function (){
	this.contentHeightToScroll = arguments[0];
}
scroll.prototype.changeContentSpeed = function (){
	this.speed = arguments[0];
}
scroll.prototype.VScrollInitialize = function (){
	this.contentdiv = arguments[0];
	this.upbutton_id = arguments[1];
	this.downbutton_id = arguments[2];
	this.min_scroll_height = '';
	if(arguments.length>3){
		this.min_scroll_height = arguments[3];
	}
	this.crossobj=document.getElementById? document.getElementById(this.contentdiv) : eval('document.all.'+this.contentdiv);
	this.contentheight = '';
}
scroll.prototype.HScrollInitialize = function (){
	this.contentdiv = arguments[0];
	this.rightbutton_id = arguments[1];
	this.leftbutton_id = arguments[2];
	if(arguments.length>3){
		this.min_scroll_width = arguments[3];
	}
	this.crossobj = document.getElementById? document.getElementById(this.contentdiv) : eval('document.all.'+this.contentdiv);
	this.contentwidth = '';
}
scroll.prototype.showScrollButtons = function (){
	this.contentheight = this.getcontent_height();
	if(this.min_scroll_height && this.min_scroll_height<this.contentheight){
		if(this.upbutton_id){
			$(this.upbutton_id).style.display = '';
		}
		if(this.downbutton_id){
			$(this.downbutton_id).style.display = '';
		}
	}
	this.contentwidth = this.getcontent_width();
	if(this.contentwidth && this.min_scroll_width<this.contentwidth){
		if(this.leftbutton_id){
			$(this.leftbutton_id).style.display = '';
		}
		if(this.rightbutton_id){
			$(this.rightbutton_id).style.display = '';
		}
	}
}
scroll.prototype.disabledOrEnabledScroolButton = function(button_id, status){
	if(status == 'disabled'){
	$(button_id).addClassName('clsScrollDisabled');
	document.getElementById(button_id).disabled = true;
	}
	else if(status == 'enabled'){
		$(button_id).removeClassName('clsScrollDisabled');
		document.getElementById(button_id).disabled = false;
	}
}
scroll.prototype.moveup = function(){
	this.contentheight = this.getcontent_height();
	if(this.downbutton_id){
		this.disabledOrEnabledScroolButton(this.downbutton_id, 'enabled');
	}
	if (this.movedownvar){
		clearTimeout(this.movedownvar)
	}
	if (parseInt(this.crossobj.style.top)<0){
		this.crossobj.style.top=parseInt(this.crossobj.style.top)+this.speed+"px"
	}
	else{
		if(this.upbutton_id){
			this.disabledOrEnabledScroolButton(this.upbutton_id, 'disabled');
		}
		return;
	}
	thisobj = this;
	this.moveupvar=setTimeout(function () {thisobj.moveup()},20)
}

scroll.prototype.movedown = function(){
	this.contentheight = this.getcontent_height();
	if(this.upbutton_id){
		this.disabledOrEnabledScroolButton(this.upbutton_id, 'enabled');
	}
	if (this.moveupvar){
		clearTimeout(this.moveupvar)
	}
/*	if (parseInt(this.crossobj.style.top)>=(this.contentheight*(-1)+this.contentHeightToScroll)){
		this.crossobj.style.top=parseInt(this.crossobj.style.top)-this.speed+"px"
	}
*/
	if( parseInt(this.min_scroll_height) <= parseInt(this.contentheight) + parseInt(this.crossobj.style.top)){
		this.crossobj.style.top=parseInt(this.crossobj.style.top)-this.speed+"px"
	}
	else{
		if(this.downbutton_id){
			this.disabledOrEnabledScroolButton(this.downbutton_id, 'disabled');
		}
		return;
	}
	thisobj = this;
	this.movedownvar=setTimeout(function () {thisobj.movedown()},20)
}

scroll.prototype.stopscroll = function(){
	if (this.moveupvar){
		clearTimeout(this.moveupvar)
	}
	if (this.movedownvar){
		clearTimeout(this.movedownvar)
	}
	if (this.moverightvar){
		clearTimeout(this.moverightvar)
	}
	if (this.moveleftvar){
		clearTimeout(this.moveleftvar)
	}
}

scroll.prototype.movetop = function(){
	this.stopscroll();
	this.crossobj.style.top=0+"px"
}

scroll.prototype.moveleft = function(){
	this.contentwidth = this.getcontent_width();
	if(this.rightbutton_id){
		this.disabledOrEnabledScroolButton(this.rightbutton_id, 'enabled');
	}
	if (this.moveleftvar){
		clearTimeout(this.moveleftvar)
	}
	if (parseInt(this.crossobj.style.left)<=0){
		this.crossobj.style.left=parseInt(this.crossobj.style.left)+this.speed+"px"
	}
	else{
		if(this.leftbutton_id){
			this.disabledOrEnabledScroolButton(this.leftbutton_id, 'disabled');
		}
		return;
	}
	thisobj = this;
	this.moverightvar=setTimeout(function () {thisobj.moveleft()},1);
}

scroll.prototype.moveright = function(){
	this.contentwidth = this.getcontent_width();
	if(this.leftbutton_id){
		this.disabledOrEnabledScroolButton(this.leftbutton_id, 'enabled');
	}
	if (this.moverightvar){
		clearTimeout(this.moverightvar)
	}
	//$('selva').value = parseInt(this.crossobj.style.left)+'>='+(this.min_scroll_width*(-1));
	if( parseInt(this.min_scroll_width) <= parseInt(this.contentwidth) + parseInt(this.crossobj.style.left)){
//	if (parseInt(this.crossobj.style.left)>=(this.min_scroll_width*(-1))){
		this.crossobj.style.left=parseInt(this.crossobj.style.left)-this.speed+"px"
	}
	else{
		if(this.rightbutton_id){
			this.disabledOrEnabledScroolButton(this.rightbutton_id, 'disabled');
		}
		return;
	}
	thisobj = this;
	var browser=navigator.appName;
	if (browser!="Microsoft Internet Explorer")
  	 this.moveleftvar=setTimeout(function () {thisobj.moveright()},1);
}

scroll.prototype.getcontent_height = function(){
	if(this.crossobj){
		return this.crossobj.offsetHeight;
	}
}

scroll.prototype.getcontent_width = function(){
	if(this.crossobj){
		return this.crossobj.offsetWidth;
	}
}
/* scrolling the div end*/
/*********** yahoo slide function end ************/
/* paging class start */
function paging(){this.carousel = false;this.anim_speed=100}
paging.prototype.initPaging = function (){
	this.display_no_of_link_per_page = 7;//it should be odd number
	this.total_pages = (Math.ceil(parseInt(this.total_records)/parseInt(this.records_per_page)));
	if(this.total_pages>0){
		this.total_pages = this.total_pages-1;
	}
	this.current_record = 0;
	this.current_action = '';
	this.catch_val = new Array();
	this.displayPaging();
}
paging.prototype.displayPaging = function (){
	this.first_class_name = 'clsFirst';
	this.last_class_name = 'clsLast';
	this.prev_class_name = 'clsPrevious';
	this.next_class_name = 'clsNext';
	this.first_onclick = 'return '+this.class_obj+'.goPage(0)';
	this.last_onclick = 'return '+this.class_obj+'.goPage('+(this.total_pages)+')';
	this.prev_onclick = 'return '+this.class_obj+'.goPrevious()';
	this.next_onclick = 'return '+this.class_obj+'.goNext()';
	if(this.current_record <= 0){
		this.current_record = 0;
		this.first_class_name = 'clsFirst clsDisabled';
		this.prev_class_name = 'clsPreviousDisable';
		this.prev_onclick = 'return false';
		this.first_onclick = 'return false';
	}
	if(this.current_record >= (this.total_pages)){
		this.current_record = this.total_pages;
		this.next_class_name = 'clsNextDisable';
		this.last_class_name = 'clsLast clsDisabled';
		this.next_onclick = 'return false';
		this.last_onclick = 'return false';
	}
	if(this.catch_val[this.current_record]){
		this.displayPagingValues();
		//alert('I am catch');
	}
	else{
		var class_object = this.class_obj;
		var class_object = eval(this);

		var url = this.paging_url;
		var method_type = this.method_type;
		var pars = this.pars+'&'+this.paging_var+'='+this.current_record*this.records_per_page;
		var myAjax = new Ajax.Request(
						url,
						{
						method: method_type,
						parameters: pars,
						onCreate: function(){
										displayLoadingImage(class_object.paging_content_id+'Process', 'title');
									},
						onComplete: function (){
										data = arguments[0].responseText;
										if(data.indexOf(session_check)>=1)
											{
												data = data.replace(session_check_replace,'');
											}
										else
											{
												return;
											}
										//For Music Module (Top Charts Block), it wont affect other module - Shankar
										if(typeof(class_object.music_case) != 'undefined')
											{
												if(class_object.music_case == 'topChartSongs' || class_object.music_case == 'topChartDownloads')
													{
														data = data.split('~###~');
														total_musics_to_play = data[0];
														data = data[1];
													}
											}
										//END OF Music Module (Top Charts Block) code
										class_object.catch_val[class_object.current_record] = data;
										class_object.displayPagingValues();
										hideLoadingImage(class_object.paging_content_id+'Process');
									}
						});

	}
}
/*
	Have applied changes for vertical animation carousel - Shankar
	When initializing carousel settings add the following line for vertical
		objName.carousel_style = 'vertical'
	and if it is horizantal no need to declare objName.carousel_style
*/
paging.prototype.animatePrevious = function(){
	var obj1 = new scroll;
	obj1.speed = this.anim_speed;
	if(typeof(this.carousel_style) == 'undefined')
		obj1.HScrollInitialize(this.paging_content_id, '', '', 0);
	else
		{
			if(this.carousel_style == 'vertical')
				obj1.VScrollInitialize(this.paging_content_id, '', '', 0);
			else
				obj1.HScrollInitialize(this.paging_content_id, '', '', 0);
		}
	obj1.showScrollButtons();
	if(typeof(this.carousel_style) == 'undefined')
		{
			$(this.paging_content_id).style.left = -($(this.paging_content_id+'_cur').offsetWidth)+"px";
			var i = (($(this.paging_content_id+'_cur').offsetWidth*1000)/(obj1.speed*20));
			//alert(i);return;
			obj2 = this;
			setTimeout(function(){obj1.stopscroll();$(obj2.paging_content_id+'_prev').hide();$(obj2.paging_content_id).style.left=0;}, i);
		}
	else
		{
			if(this.carousel_style == 'vertical')
				{
					$(this.paging_content_id).style.top = -($(this.paging_content_id+'_cur').offsetHeight)+"px";
					var i = (($(this.paging_content_id+'_cur').offsetHeight*1000)/(obj1.speed*20));
					//alert(i);return;
					obj2 = this;
					setTimeout(function(){obj1.stopscroll();$(obj2.paging_content_id+'_prev').hide();$(obj2.paging_content_id).style.top=0;}, i);
				}
			else
				{
					$(this.paging_content_id).style.left = -($(this.paging_content_id+'_cur').offsetWidth)+"px";
					var i = (($(this.paging_content_id+'_cur').offsetWidth*1000)/(obj1.speed*20));
					//alert(i);return;
					obj2 = this;
					setTimeout(function(){obj1.stopscroll();$(obj2.paging_content_id+'_prev').hide();$(obj2.paging_content_id).style.left=0;}, i);
				}
		}

	if(typeof(this.carousel_style) == 'undefined')
		obj1.moveleft();
	else
		{
			if(this.carousel_style == 'vertical')
				obj1.moveup();
			else
				obj1.moveleft();
		}
}
/*
	Have applied changes for vertical animation carousel - Shankar
	When initializing carousel settings add the following line for vertical
		objName.carousel_style = 'vertical'
	and if it is horizantal no need to declare objName.carousel_style
*/
paging.prototype.animateNext = function(){
	var obj1 = new scroll;
	obj1.speed = this.anim_speed;
	//alert(this.carousel_style);//this.carousel_style = 'vertical'
	if(typeof(this.carousel_style) == 'undefined')
		obj1.HScrollInitialize(this.paging_content_id, null, null, 0);
	else
		{
			if(this.carousel_style == 'vertical')
				obj1.VScrollInitialize(this.paging_content_id, null, null, 0);

			else
				obj1.HScrollInitialize(this.paging_content_id, null, null, 0);
		}

	obj1.showScrollButtons();
	if(typeof(this.carousel_style) == 'undefined')
		{
			var i = ($(this.paging_content_id+'_cur').offsetWidth*1000)/(obj1.speed*20);
			if (navigator.appName == "Microsoft Internet Explorer"){
				i = i/3;
			}

			obj2 = this;
			setTimeout(function(){obj1.stopscroll();$(obj2.paging_content_id+'_next').hide();$(obj2.paging_content_id).style.left=0;}, i);
		}
	else
		{
			if(this.carousel_style == 'vertical')
				{
					var i = ($(this.paging_content_id+'_cur').offsetHeight*1000)/(obj1.speed*20);
					if (navigator.appName == "Microsoft Internet Explorer"){
						i = i/3;
					}
					//alert(i);return;
					obj2 = this;
					setTimeout(function(){obj1.stopscroll();$(obj2.paging_content_id+'_next').hide();$(obj2.paging_content_id).style.top=0;}, i);
				}
			else
				{
					var i = ($(this.paging_content_id+'_cur').offsetWidth*1000)/(obj1.speed*20);
					if (navigator.appName == "Microsoft Internet Explorer"){
						i = i/3;
					}

					obj2 = this;
					setTimeout(function(){obj1.stopscroll();$(obj2.paging_content_id+'_next').hide();$(obj2.paging_content_id).style.left=0;}, i);

				}
		}
	//alert($(this.paging_content_id+'_cur').offsetWidth);return;

	if(typeof(this.carousel_style) == 'undefined')
		obj1.moveright();
	else
		{
			if(this.carousel_style == 'vertical')
				obj1.movedown();
			else
				obj1.moveright();
		}

}
paging.prototype.displayPagingValues = function (){
	//fade, slide, glide, wipe, unfurl, grow, shrink, highlight
	if(this.carousel){
		if(this.current_action=='previous'){
			$(this.paging_content_id).innerHTML = '<ul class="clsPagingContent"><li id="'+this.paging_content_id+'_cur">'+this.catch_val[this.current_record]+'</li><li id="'+this.paging_content_id+'_prev">'+$(this.paging_content_id+'_cur').innerHTML+'</li></ul>';
			this.animatePrevious();
		}
		else if(this.current_action=='next'){
			$(this.paging_content_id).innerHTML = '<ul class="clsPagingContent"><li id="'+this.paging_content_id+'_next">'+$(this.paging_content_id+'_cur').innerHTML+'</li><li id="'+this.paging_content_id+'_cur">'+this.catch_val[this.current_record]+'</li></ul>';
			this.animateNext();
		}
		else{
			$(this.paging_content_id).innerHTML = '<ul class="clsPagingContent"><li id="'+this.paging_content_id+'_cur">'+this.catch_val[this.current_record]+'</li></ul>';
		}
	}else{
	$(this.paging_content_id).innerHTML = this.catch_val[this.current_record];
		Zapatec.Effects.show(this.paging_content_id, 5, 'fade');
	}Zapatec.Effects.show(this.paging_content_id, 5, 'fade');
	if(this.paging_style == 'simple'){
		this.populatePageLinksSimple();
	}else if(this.paging_style == 'extend'){
		this.populatePageLinksExtend();
	}
}
paging.prototype.populateCurrentRecord = function(){
	if((this.page_no_id!='') && ($(this.page_no_id))){
			var sr = (this.current_record*parseInt(this.records_per_page))+1;
			sr = (sr)?sr:1;
			var er = sr+parseInt(this.records_per_page)-1;
			er = er>this.total_records?this.total_records:er;
			var txt = StringReplcae('{start}', sr, this.page_no_text);
			txt = StringReplcae('{end}', er, txt);
			txt = StringReplcae('{total}', this.total_records, txt);
			$(this.page_no_id).innerHTML = txt;
		}
}
paging.prototype.populatePageLinksSimple = function (){
	if(this.isPagingRequired()){
		var paging_links = '<ul><li class="clsPreviousVideo"><a href="javascript:void(0);" class="'+this.prev_class_name+'" onClick="'+this.prev_onclick+'">Previous</a></li>';
		paging_links += '<li class="clsNextVideo"><a href="javascript:void(0);" class="'+this.next_class_name+'" onClick="'+this.next_onclick+'">Next</a></li></ul>';
		this.populateCurrentRecord();
		$(this.paging_link_id).innerHTML = paging_links;
	}
}
paging.prototype.isPagingRequired = function (){
	return this.total_pages>0;
}
paging.prototype.populatePageLinksExtend = function(){
	if(!this.isPagingRequired())
		return;

	var paging_links = '<span class="'+this.first_class_name+'"><a href="javascript:void(0);" onClick="'+this.first_onclick+'">First</a></span>';
	paging_links += '<span class="'+this.prev_class_name+'"><a href="javascript:void(0);" onClick="'+this.prev_onclick+'">Previous</a></span>';

	var cr = this.current_record+1;
	var start = Math.ceil(this.display_no_of_link_per_page/2);
	start = cr-start;
	start = start<=0?1:start+1;
	var end = start+this.display_no_of_link_per_page-1;
	if(end>this.total_pages+1){
		end = this.total_pages+1;
	}
	if((end-start+1)<this.display_no_of_link_per_page){
		start = end-this.display_no_of_link_per_page+1;
		start = start<=0?1:start;
	}
	for(var i=start; i<=end; i++){
		inc = i-1;
		if(this.current_record == inc){
			paging_links += '<span class="clsPageLink clsDisabled"><a href="javascript:void(0);" onClick="return false">'+i+'</a></span>';
		}else{
			page_onclick = 'return '+this.class_obj+'.goPage('+inc+')';
			paging_links += '<span class="clsPageLink clsEnabled"><a href="javascript:void(0);" onClick="'+page_onclick+'">'+i+'</a></span>';
		}
	}

	paging_links += '<span class="'+this.next_class_name+'"><a href="javascript:void(0);" onClick="'+this.next_onclick+'">Next</a></span>';
	paging_links += '<span class="'+this.last_class_name+'"><a href="javascript:void(0);" onClick="'+this.last_onclick+'">Last</a></span>';

	this.populateCurrentRecord();
	$(this.paging_link_id).innerHTML = paging_links;
}
paging.prototype.goPrevious = function (){
	this.current_action = 'previous';
	this.current_record -= 1;
	this.displayPaging();

	//FOR MUSIC MODULE INDEX PAGE
	if(typeof(index_play_music_id) != 'undefined' && typeof(index_current_play_block) != 'undefined')
		{
			if(index_play_music_id != '' && index_current_play_block != '')
				highlightIndexCurrentMusic();
		}
	return false;
}
paging.prototype.goNext = function (){
	this.current_action = 'next';
	this.current_record += 1;
	this.displayPaging();

	//FOR MUSIC MODULE INDEX PAGE
	if(typeof(index_play_music_id) != 'undefined' && typeof(index_current_play_block) != 'undefined')
		{
			if(index_play_music_id != '' && index_current_play_block != '')
				highlightIndexCurrentMusic();
		}
	return false;
}
paging.prototype.goPage = function (){
	if(this.current_record<arguments[0]){
		this.current_action = 'next';
	}else{
		this.current_action = 'previous';
	}
	this.current_record = arguments[0];
	this.displayPaging();
	return false;
}
/* paging class End */
var displayLoadingImage = function(){
	var divid = arguments[0];
	var img_type = arguments[1];
	if(!$(divid)){
		return;
	}
	var img_src = '';
	switch(img_type)
		{
			case 'title':
				//img_src = '<img src="'+SITE_URL+'design/templates/'+TEMPLATE_NAME+'/root/images/'+THEME_NAME+'/ajax-loader.gif" />';
				img_src = '<img src="common/files/ajax/icon_loader_small.gif" />';
				break;

			case 'content':
					img_src = '<img src="common/files/ajax/icon_loader_medi.gif" />';
				break;
		}
	$(divid).innerHTML = img_src;
	$(divid).show();
}
var hideLoadingImage = function(){
	var divid = arguments[0];
	if(!$(divid)){
		return;
	}
	$(divid).hide();
	$(divid).innerHTML = '';
}

function timeDifference(startDate,endDate){
	date1 = startDate;
	date2 = endDate;

	laterdate = date1.split('-');
	laterY=laterdate[0];
	laterM=laterdate[1];
	laterD=laterdate[2];

	earlierdate = date2.split('-');
	earlierY=earlierdate[0];
	earlierM=earlierdate[1];
	earlierD=earlierdate[2];

	var laterdate = new Date(laterY,laterM,laterD);
	var earlierdate = new Date(earlierY,earlierM,earlierD);

	var difference = laterdate.getTime() - earlierdate.getTime();

	var daysDifference = Math.floor(difference/1000/60/60/24);
	difference -= daysDifference*1000*60*60*24
	var hoursDifference = Math.floor(difference/1000/60/60);
	difference -= hoursDifference*1000*60*60
	var minutesDifference = Math.floor(difference/1000/60);
	difference -= minutesDifference*1000*60
	var secondsDifference = Math.floor(difference/1000);

	return daysDifference;
}

function urlencode( str ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Philip Peterson
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +      input by: AJ
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // %          note: info on what encoding functions to use from: http://xkr.us/articles/javascript/encode-compare/
    // *     example 1: urlencode('Kevin van Zonneveld!');
    // *     returns 1: 'Kevin+van+Zonneveld%21'
    // *     example 2: urlencode('http://kevin.vanzonneveld.net/');
    // *     returns 2: 'http%3A%2F%2Fkevin.vanzonneveld.net%2F'
    // *     example 3: urlencode('http://www.google.nl/search?q=php.js&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a');
    // *     returns 3: 'http%3A%2F%2Fwww.google.nl%2Fsearch%3Fq%3Dphp.js%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt%26rls%3Dcom.ubuntu%3Aen-US%3Aunofficial%26client%3Dfirefox-a'

    var histogram = {}, histogram_r = {}, code = 0, tmp_arr = [];
    var ret = str.toString();

    var replacer = function(search, replace, str) {
        var tmp_arr = [];
        tmp_arr = str.split(search);
        return tmp_arr.join(replace);
    };

    // The histogram is identical to the one in urldecode.
    histogram['!']   = '%21';
    histogram['%20'] = '+';

    // Begin with encodeURIComponent, which most resembles PHP's encoding functions
    ret = encodeURIComponent(ret);

    for (search in histogram) {
        replace = histogram[search];
        ret = replacer(search, replace, ret) // Custom replace. No regexing
    }

    // Uppercase for full PHP compatibility
    return ret.replace(/(\%([a-z0-9]{2}))/g, function(full, m1, m2) {
        return "%"+m2.toUpperCase();
    });

    return ret;
}

function urldecode( str ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Philip Peterson
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +      input by: AJ
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // %          note: info on what encoding functions to use from: http://xkr.us/articles/javascript/encode-compare/
    // *     example 1: urldecode('Kevin+van+Zonneveld%21');
    // *     returns 1: 'Kevin van Zonneveld!'
    // *     example 2: urldecode('http%3A%2F%2Fkevin.vanzonneveld.net%2F');
    // *     returns 2: 'http://kevin.vanzonneveld.net/'
    // *     example 3: urldecode('http%3A%2F%2Fwww.google.nl%2Fsearch%3Fq%3Dphp.js%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt%26rls%3Dcom.ubuntu%3Aen-US%3Aunofficial%26client%3Dfirefox-a');
    // *     returns 3: 'http://www.google.nl/search?q=php.js&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a'

    var histogram = {}, histogram_r = {}, code = 0, str_tmp = [];
    var ret = str.toString();

    var replacer = function(search, replace, str) {
        var tmp_arr = [];
        tmp_arr = str.split(search);
        return tmp_arr.join(replace);
    };

    // The histogram is identical to the one in urlencode.
    histogram['!']   = '%21';
    histogram['%20'] = '+';

    for (replace in histogram) {
        search = histogram[replace]; // Switch order when decoding
        ret = replacer(search, replace, ret) // Custom replace. No regexing
    }

    // End with decodeURIComponent, which most resembles PHP's encoding functions
    ret = decodeURIComponent(ret);

    return ret;
}

/******* Start Trim Functions ************/
function Trim(TRIM_VALUE)
	{
		if(TRIM_VALUE.length < 1)
			{
				return "";
			}
		TRIM_VALUE = RTrim(TRIM_VALUE);
		TRIM_VALUE = LTrim(TRIM_VALUE);
		if(TRIM_VALUE=="")
			{
				return "";
			}
		else
			{
				return TRIM_VALUE;
			}
	}

function RTrim(VALUE)
	{
		var w_space = String.fromCharCode(32);
		var v_length = VALUE.length;
		var strTemp = "";
		if(v_length < 1)
			{
				return "";
			}
		var iTemp = v_length -1;
		while(iTemp > -1)
			{
				if(VALUE.charAt(iTemp) == w_space)
					{
					}
				else
					{
						strTemp = VALUE.substring(0,iTemp +1);
						break;
					}
				iTemp = iTemp-1;

			}
		return strTemp;
	}

function LTrim(VALUE)
	{
		var w_space = String.fromCharCode(32);
		if(v_length < 1)
			{
				return "";
			}
		var v_length = VALUE.length;
		var strTemp = "";

		var iTemp = 0;

		while(iTemp < v_length)
			{
				if(VALUE.charAt(iTemp) == w_space)
					{
					}
				else
					{
						strTemp = VALUE.substring(iTemp,v_length);
						break;
					}
				iTemp = iTemp + 1;
			}
		return strTemp;
	}
/***********End trim functions********/
function RegularExpressionReplace(expression, subject, replaced)
	{
	  var re = new RegExp(expression, "g");
	  return subject.replace(re, replaced);
	}
function StringReplcae(find_string, replace_string, subject)
	{
		return RegularExpressionReplace(find_string, subject, replace_string);
	}
function replace_string(str, search_str, replace_str)
	{
			var condition = true;
			var inc= 1;
			while(condition)
				{
					str = str.replace(search_str,replace_str);
					if(str.indexOf(search_str)<0)
						condition = false;
					inc++;
				}
			return str;
	}
//**************** confirmation box related functions Start *******************/
//Change position of the confirmation block
function getAbsoluteOffsetTopConfirmation(obj){
	if(obj)
	{
	    var top = obj.offsetTop;
	    var parent = obj.offsetParent;
	    while (parent != document.body)
			{
		        top += parent.offsetTop;
		        parent = parent.offsetParent;
		    }
	    return top;
	}
	}

function getAbsoluteOffsetLeftConfirmation(obj){
	    var left = obj.offsetLeft;
	    var parent = obj.offsetParent;
	    while (parent != document.body)
			{
		        left += parent.offsetLeft;
		        parent = parent.offsetParent;
		    }
	    return left;
	}

//Hide all confirmation blocks
function hideAllBlocks(){
		var obj;

		if(obj = $('selAlertbox'))
			obj.style.display = 'none';

		for(var i=0;i<block_arr.length;i++){
				if(obj = $(block_arr[i]))
					obj.style.display = 'none';
			}
		if(obj = $('hideScreen'))
			obj.style.display='none';

		if(obj = $('selAjaxWindow'))
			obj.style.display='none';

		if(obj = $('selAjaxWindowInnerDiv'))
			obj.innerHTML='';

		return false;
	}

//Get multible check box value with comma seperator
var multiCheckValue='';
var minimum_top = 20;
var minimum_left = 20;
var zIndexValue = 999999;
// form_name, check_all_name, alert_value, place
var getMultiCheckBoxValue = function(){
	var form_name = arguments[0];
	var check_all_name = arguments[1];
	if(arguments.length>2){
		var alert_value = arguments[2];
	}
	var frm = eval('document.'+form_name);
	var ids = '';
	multiCheckValue = '';
	for(var i=0;i<frm.elements.length;i++){
		var e=frm.elements[i];
		if ((e.name != check_all_name) && (e.type=='checkbox') && e.checked)
			ids += e.value+',';
	}
	if(ids){
		multiCheckValue =ids.substring(0,ids.length-1);
		return true;
	}
	if(arguments.length>2){
			alert_manual(alert_value);
	}
	return false;
}

var alert_manual = function()
	{
		var obj;
		var alert_value = arguments[0];
		if(obj = $('selAlertMessage'))
			obj.innerHTML = alert_value;
		if(fromObj = $('selAlertbox'))
			changePosition(fromObj);
		if(obj = $('selAlertOkButton'))
			obj.focus();
		return false;
	}

//ChangePosition changed for IE6 confimation box position since confimation box is displayed in non visible area - Shankar
//changePosition(fromObj, toObj, add_top_position, add_left_position){
//toObj, add_top_position, add_left_position are optional (Fix for IE 6)
var changePosition = function()
	{
		var fromObj = arguments[0];

		var toObj = '';
		var add_top_position = '';
		var add_left_position = '';

		if(arguments[1])
			toObj = arguments[1];

		if(arguments[2])
			add_top_position = arguments[2];

		if(arguments[3])
			add_left_position = arguments[3];

		var obj = fromObj;
		obj.style.display = 'block';

		if(toObj && add_top_position && add_left_position)
			{
				var movedivtop = getAbsoluteOffsetTopConfirmation(toObj)+ add_top_position;

				var movedivleft = getAbsoluteOffsetLeftConfirmation(toObj)+ add_left_position;
				if(movedivtop < minimum_top)
					movedivtop = minimum_top;

				if(movedivleft < minimum_left)
					movedivleft = minimum_left;
			}
		else
			{
				if (navigator.appName == "Microsoft Internet Explorer")
					{
						var scrolltop = document.body.scrollTop;
						var scrollleft = document.body.scrollLeft;
						var innerheight = document.body.offsetHeight;
						var innerwidth = document.body.offsetWidth;
						var divwidth = obj.offsetWidth;
						var divheight = obj.offsetHeight;
						/*if(innerwidth > 1024)
			 				innerwidth = 1024;
			 			if(innerHeight > 602)
			 				innerHeight = 602;*/
					}
				else
					{
						var scrolltop = window.pageYOffset;
						var scrollleft = window.pageXOffset;
						var innerheight = window.innerHeight;
						var innerwidth = window.innerWidth;
						var divwidth = obj.offsetWidth;
						var divheight = obj.offsetHeight;
					}
				//alert(innerwidth+'---'+innerheight);
				if(obj.style.position == 'fixed')
					{
						var movedivleft = (parseInt(innerwidth)/2)-(parseInt(divwidth)/2);
						var movedivtop = (parseInt(innerheight)/2)-(parseInt(divheight)/2);
					}
				else
					{
						var movedivleft = (parseInt(innerwidth)/2)+(parseInt(scrollleft))-(parseInt(divwidth)/2);
						var movedivtop = (parseInt(innerheight)/2)+(parseInt(scrolltop))-(parseInt(divheight)/2);
					}
			}

		obj.style.top = movedivtop + 'px';
		obj.style.left = movedivleft + 'px';
		obj.style.zIndex = zIndexValue;
		if(obj = $('hideScreen'))
			{
				var ss = getPageSizeWithScroll();
				var ua = navigator.userAgent.toLowerCase();
				if(ua.indexOf("msie") != -1){
					obj.style.width=ss[0]+"px";
				}
				obj.style.height=ss[1]+"px";
				obj.style.display='block';
			}
		//fade, slide, glide, wipe, unfurl, grow, shrink, highlight
		//Zapatec.Effects.show(fromObj.id, 5, 'shrink')
		$(fromObj).show();
		return false;
	}

function showHideScreen(divElm){
	var fromObj = $(divElm);
	fromObj.style.zIndex = zIndexValue;
	fromObj.style.display = 'block';
	if(obj = $('hideScreen')){
		var ss = getPageSizeWithScroll();
		var ua = navigator.userAgent.toLowerCase();

		if(ua.indexOf("msie") != -1){
			obj.style.width=ss[0]+"px";
		}
		obj.style.height=ss[1]+"px";
		obj.style.display='block';
		return false;
	}
}
function showHideLang() {
var ul = document.getElementById('langlist');
var i=0, total_lang_li =0;
while(ul.getElementsByTagName('li')[i++]) total_lang_li++;
if(total_lang_li<=0)return false;
$('showhidelang').toggle();
if($('showhidetheme'))
	$('showhidetheme').style.display='none';
}
function showHideTheme() {
var ul = document.getElementById('themelist');
var k=0, total_theme_li =0;
while(ul.getElementsByTagName('li')[k++]) total_theme_li++;
if(total_theme_li<=0)return false;
$('showhidetheme').toggle();
if($('showhidelang'))
	$('showhidelang').style.display='none';
}
function makeQueryAsFormFieldValues(form_name)
	{
		var query = '';
		var frm = eval('document.'+form_name);
		for(var i=0;i<frm.elements.length;i++){
				var e=frm.elements[i];
				if (e.type!='button' && e.type!='checkbox'){
						if(e.type == 'password') //Added by Shankar to convert special characters, need to use urldecode in php
							query += e.name+'='+encodeURIComponent(e.value)+'&';
						else
							query += e.name+'='+e.value+'&';
					}
			}
		query =query.substring(0,query.length-1);
		return query;
	}

//Display confirmation Block
//block, form_name, id_array, value_array, property_array, add_top_position, add_left_position, place
//property_array, add_top_position, add_left_position, place --- optional
var Confirmation = function(){
	var obj, inc, form_field;
	hideAllBlocks();

	var block = arguments[0];
	var form_name = arguments[1];
	var id_array = arguments[2];
	var value_array = arguments[3];

	var property_array = new Array();
	multiCheckValue ='';

	if(arguments.length>=5)
		property_array = arguments[4];

	for(inc=0; inc<value_array.length;inc++){
		if(!property_array[inc])
			property_array[inc] = 'value';
		form_field = eval('document.'+form_name+'.'+id_array[inc]);
		if(form_field && form_field[property_array[inc]]!=null)
			form_field[property_array[inc]] = value_array[inc];
		else if(obj = $(id_array[inc]))
			obj[property_array[inc]] = value_array[inc];
	}

	if(fromObj = $(block))
		{
			if(arguments[5] && arguments[6] && arguments[7])
				changePosition(fromObj, $(arguments[7]), arguments[5], arguments[6]);
			else
				changePosition(fromObj);
		}

	return false;
}
function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	return arrayPageSizeWithScroll;
}
//**************** confirmation box related functions End *******************/
/*function changeWidth(){
	var width_value = document.formGetCode.image_width.value;
	if(parseInt(max_width_value)>=parseInt(width_value)){
		var expression = 'width="([0-9]+)"';
		var subject = document.formGetCode.image_code.value;
		var replaced = 'width="'+width_value+'"';
		document.formGetCode.image_code.value = RegularExpressionReplace(expression, subject, replaced);
	}
}*/

var getCheckBoxValue = function(){
	var form_name = arguments[0];
	var check_all_name = arguments[1];
	var frm = eval('document.'+form_name);
	var ids = '';
	for(var i=0;i<frm.elements.length;i++){
		var e=frm.elements[i];
		if ((e.name != check_all_name) && (e.type=='checkbox') && e.checked)
			ids += e.value+',';
	}
	if(ids){
		multiCheckValue =ids.substring(0,ids.length-1);
		return true;
	}
	return false;
}

function openAjaxWindow(linkid, url){
	ajaxWindowLink = linkid;
	linkobj = document.getElementById(linkid);
	var file_url = linkobj.href;
	pars = 'media_path='+file_url;
	var myAjax = new Ajax.Request(
								url,
								{
								method: 'get',
								parameters: pars,
								onComplete: ajaxResultOpenAjaxWindow
								});
								return false;
}

function ajaxResultOpenAjaxWindow(originalRequest){
	data = originalRequest.responseText;
	Confirmation(ajaxWindowLink, 'selAjaxWindow', 'frmAjaxWindow', Array('selAjaxWindowInnerDiv'), Array(data), Array('innerHTML'), ajaxWindowYPos, ajaxWindowXPos);
}

//For sorting
function changeOrderbyElements(form_name,field_name){
	 	var obj = eval("document."+form_name+".orderby_field");
	 	obj.value = field_name;
	 	obj = eval("document."+form_name+".orderby");
	 	if(obj.value=="asc")
	 		obj.value="desc";
	 	else
	 		obj.value="asc";
	 	eval("document."+form_name+".submit()");
	 	return false;
	}

//for postmethod to paging
function pagingSubmit(formname, start){
	var obj = eval("document."+formname);
	obj.start.value = start;
	obj.submit();
	return false;
}

function facebookLogout()
	{
		facebook_logout.document.location = cfg_site_url+'members/facebookLogout.php';
		return false;
	}

// Open External Links as Blank Targets
function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		var anchor_href = anchor.getAttribute("href");
		if (anchor_href && anchor_href.indexOf(cfg_site_url)==-1 && anchor_href.indexOf('http://')==0){
			//alert(anchor_href+"--"+anchor_href.indexOf(cfg_site_url));
			anchor.target = "_blank";
		}
	}
}
//onfocus, onblur, issues fixed
function chkValueInArray(value)
	{
		if(form_name_array.length == 0)
			return false;
		for (i=0; i < form_name_array.length; i++)
			{
				if (form_name_array[i] == value)
					{
						return true;
					}
			}
	}
function helpTipInitialize(){
	var forms_length = document.forms.length;
	for (var i=0; i<forms_length; i++) {
		var elements_length = document.forms[i].elements.length;

		for (var j=0; j<elements_length; j++) {
			if(!chkValueInArray(document.forms[i].name) )
				{
					document.forms[i].elements[j].onfocus = showTip;
					document.forms[i].elements[j].onblur = hideTip;
				}

		}
	}
}

function showTip(){
	var tip_id = this.id;

	var pos = tip_id.indexOf('_opt_');
	if(pos!=-1){
		tip_id = tip_id.substr(0, pos);
	}
	var tip_id = $(tip_id+'_Help');
	if(tip_id){
		tip_id.style.visibility = 'visible';
	}
}

function hideTip(){
	var tip_id = this.id;
	var pos = tip_id.indexOf('_opt_');
	if(pos!=-1){
		tip_id = tip_id.substr(0, pos);
	}
	var tip_id = $(tip_id+'_Help');
	if(tip_id){
		tip_id.style.visibility = 'hidden';
	}
}

function windowOpen(obj){
	window.open(obj.href,'mywindow','toolbar=no, location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=no');
	return false;
}

function setFullScreenBrowser(){
	window.moveTo(0,0);
	window.resizeTo(screen.width,screen.height);
}

function hideAnimateBlock(elmt){
	//fade, slide, glide, wipe, unfurl, grow, shrink, highlight
	Zapatec.Effects.hide(elmt, 0.4, 'fade')
}

var captcha_count = 0;
function resetCaptcha(elmt, url){
	captcha_count++;
	$(elmt).src = 'ss';
	$(elmt).src = url+'?'+captcha_count;
	return false
}

function addClassNameForDataTable(){
	this.addClassName('clsDataMouseoverRow')
}

function removeClassNameForDataTable(){
	this.removeClassName('clsDataMouseoverRow')
}

function getHTML(url, pars, divname, method_type){
	var myAjax = new Ajax.Updater(
						divname,
						url,
						{
						method: method_type,
						parameters: pars,
						evalJS: true,
						evalScripts: true
						});
}

var Redirect2URL = function(){
		if(arguments[0])
			location.replace(arguments[0]);
		else
			window.back();
		return false;
	}

function setCookie(c_name,value,expiredays){
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name){
	if (document.cookie.length>0){
 		c_start=document.cookie.indexOf(c_name + "=");
 		if (c_start!=-1){
		   	c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
    		if (c_end==-1) c_end=document.cookie.length;
    		return unescape(document.cookie.substring(c_start,c_end));
    	}
  	}
	return "";
}

function chkValidTags(tags){
	var val;
	var i;
	tags = Trim(tags);
	if(tags=='')
		return true;
	tags = tags.split(' ');
	for (i=0;i<tags.length;i++){
		val = Trim(tags[i]);
		if(val=='')
			continue;
		if((val.length<min_tag_size) || (val.length>max_tag_size))
			return true;
	}
	return false;
}

//Common Prototype.js ajax request function
function prototype_ajax(url, function_name)
	{
		//var pars = 'ajaxTodo=update&language='+language;
		var pars = '';

		var myAjax = new Ajax.Request(
						url,
						{
						method: 'post',
						parameters: pars,
						evalJS: true,
						evalScripts: true,
						onComplete: eval(function_name)
						//onComplete: function(){ajax_response_data = unescape(arguments[0].responseText);eval(div_id+'()')}
						});
						return false;
	   	return false;

	}
/* ************** Start Search text functions ************** */
//for search text box
var displayDefaultValue = function(obj, dValue){
	var objValue = obj.value;
	if (objValue == '')
		obj.value = dValue;
}
//for search text box
var clearDefaultValue = function(obj, dValue){
	var objValue = obj.value;
	objValue = objValue.toLowerCase()
	if (objValue == dValue)
		obj.value = '';
}
var checkforSearchText = function(obj, dValue, msg){
	clearDefaultValue(obj, dValue);
	var objValue = obj.value;
	if (objValue)
		return true;
	alert_manual(msg);
	obj.focus();
	return false;
}
/* ************** End Search text functions ************** */
//function for disable the select all checkbox column
function disableHeading(frmname)
	{
			var targetForm = document.getElementById(frmname);

			for (var i=1; i<targetForm.elements.length; i++)
				{
					if (targetForm.elements[i].type == "checkbox")
					{	//alert(i);
						if (targetForm.elements[i].checked)
						{	//alert('chekall');
							targetForm.elements[0].checked=true;
						}
						else
						{
							targetForm.elements[0].checked=false;
							break;
						}
					}
				}
	}
/**
 *
 * @access public
 * @return void
 **/
function newTabWindow(url)
{
	window.open(url,'_new');
}

/**
 *
 * @access public
 * @return void
 **/
function slideDiv(id){
Effect.toggle(id, 'slide', {});
}


function getImageDetail(photo_id){

width=$('image_'+photo_id).getWidth()+1;
height=$('image_'+photo_id).getHeight()+1;
id='detail_'+photo_id;
$(id).setStyle({display:'block',width:width+'px',height:height+'px'});
}
function hideImageDetail(photo_id){

id='detail_'+photo_id;
$(id).setStyle({display:'none'});
}

/**
 *
 * @access public
 * @return void
 **/
function ReplyCommentPopup(url,comment_id){
reply_comment_id=comment_id;
replyUrl=url;
postCommentsWindow();
}

var img_src = new Array();
function mouseOver(count)
	{
		for(var i=1; i<=count; i++)
			{
				var obj = document.getElementById('img'+i);
				img_src[i] = obj.src;
				obj.src = rateimagehover_url;
			}
		for(; i<=total_images; i++)
			{
				var obj = document.getElementById('img'+i);
				img_src[i] = obj.src;
				obj.src = rateimage_url;
			}
	}

function mouseOut(count)
	{
		for(var i=1; i<=total_images; i++)
			{
				var obj = document.getElementById('img'+i);
				obj.src = img_src[i];
			}
	}
//functions for rating
var rate_click = true;
function callAjaxRate(path, div_id)
	{
		if(!rate_click)
			return false;
		rate_click = false;
		result_div = div_id;
		new AG_ajax(path,'ajaxResultRate');
		setTimeout('changeRatingStatus()',2000);
		return false;
	}
function changeRatingStatus(){
		rate_click = true;
}
function ajaxResultRate(data)
	{
		data = unescape(data);
		var obj = document.getElementById(result_div);
		obj.style.display = 'block';
		if(data.indexOf(session_check)>=1)
			{
				data = data.replace(session_check_replace,'');
			}
		else
			{
				return;
			}

		if(data)
			{
				obj.innerHTML = data;
				obj.style.top = getAbsoluteOffsetTopConfirmation(document.getElementById('dAltMulti')) + 'px';
			}
	}


function loadChangeClass(hoverElement,subMenuClassName)
{
	var submenu=$$(hoverElement);
	submenu.each(function(menu)
	{
		if(menu.className!==subMenuClassName)
		{
			menu.observe('mouseover', function()
			{
				menu.addClassName(subMenuClassName);
			});
			menu.observe('mouseout', function()
			{
				menu.removeClassName(subMenuClassName);
			});
		}
	});
}

//To select Content inside DIV element like Textarea
function fnSelect(objId) {
			fnDeSelect();
			if (document.selection) {
				var range = document.body.createTextRange();
				range.moveToElementText(document.getElementById(objId));
				range.select();
			}
			else if (window.getSelection) {
				var range = document.createRange();
				range.selectNode(document.getElementById(objId));
				window.getSelection().addRange(range);
			}
		}

//To un-select selected Content inside DIV element
function fnDeSelect() {
	if (document.selection) document.selection.empty();
	else if (window.getSelection) window.getSelection().removeAllRanges();
}

function divShowHide(div_id, show_link_id, hide_link_id)
	{
		if($(div_id).style.display == 'none')
			{
				$(show_link_id).hide();
				$(hide_link_id).show();
				$(div_id).show();
			}
		else
			{
				$(show_link_id).show();
				$(hide_link_id).hide();
				$(div_id).hide();
			}
	}

function hideMoreTabsDivs(current_div)
	{
		for(var i=0; i<more_tabs_div.length; i++)
			{
				if(more_tabs_div[i] != current_div)
					{
						$(more_tabs_div[i]).hide();
						setClass(more_tabs_class[i],'');
					}
			}
	}

function showMoreTabsDivs(current_div)
	{
		for(var i=0; i<more_tabs_div.length; i++)
			{
				if(more_tabs_div[i] == current_div)
					{
						$(current_div).show();
						setClass(more_tabs_class[i], current_active_tab_class);
						break;
					}
			}
	}

function memberBlockLoginConfirmation(msg,url)
	{
		document.msgConfirmformMulti1.action = url;
		return Confirmation('selMsgLoginConfirmMulti', 'msgConfirmformMulti1', Array('selAlertLoginMessage'), Array(msg), Array('innerHTML'));
	}
