/*
	Copyright 2010;
	main_cli.js v 2.0 2010.04.01;
	Javascript Main File
*/

	var homeDialogBox=false;
	
	function jsonIstring(mstring){
		
		mstring=mstring.replace(/&quot;/gi,'"');
		return mstring;
	}
	
	var ajaxloadPage=false;
	
	function ajaxpage(url, containerid){
	
		$('#'+containerid).html("<p><img src='"+vsubpath+"/img/ajax-loader2.gif' border='0'  align=absmiddle></p>");
  		$('#'+containerid).load(url+"&isajax=true");
	}
	
	
	var editorMY=[];
	var errorOffsetTop=0;
	
	function eloffsetTop(elid){
		 var offset = $('#'+elid).offset();
		 
		 return offset.top;
	}
	
	function checkFormDefaulttextNone(oCheckformId){
		
		var Checkform=document.getElementById(oCheckformId);	
		
		inputInd=0;		
		while(Checkform.getElementsByTagName('input')[inputInd]){
			
			var testinput=Checkform.getElementsByTagName('input')[inputInd];
			
			if (testinput.className.indexOf("defaultText")!=-1 && testinput.value==testinput.title ) {
				testinput.value='';	
			}
			
			inputInd++;
		}
		
		
		textareaInd=0;
		while(Checkform.getElementsByTagName('textarea')[textareaInd])
		{			
			var testarea=Checkform.getElementsByTagName('textarea')[textareaInd];						
			
			if (testarea.className.indexOf("defaultText")!=-1 && testarea.value==testarea.title) {
					testarea.value='';	
			}
		
			textareaInd++;
		}	
			
	}
	
	function checkFormConvert(oCheckformId,winpos){
		var formError=0;
		var Checkform=document.getElementById(oCheckformId);
		var oldElemen;
		errorOffsetTop=0;
		
		if(Checkform){
			
			flocaltime=0;
			inputInd=0;		
			while(Checkform.getElementsByTagName('input')[inputInd])
			{
				
				var testinput=Checkform.getElementsByTagName('input')[inputInd];
	
				if(testinput.name=='factionldate')
					flocaltime=1;
				if (testinput.className.indexOf("im_extvalidEmail")!=-1 ) {
					if(!validateEmail(testinput.id)){
						formError++;
						//&& testinput.className.indexOf("nooffset")==-1
						if((errorOffsetTop>eloffsetTop(testinput.id) || errorOffsetTop==0) ) errorOffsetTop=eloffsetTop(testinput.id);
						
					}
				}
				else
					if (testinput.className.indexOf("im_extvalidREEmail")!=-1 || testinput.className.indexOf("im_extvalidREpass")!=-1 ) {
						if(oldElemen && oldElemen.value!=testinput.value || testinput.value==''){
							if (testinput.className.indexOf("im_extvalidREEmail")!=-1)
								validateInputRE(testinput.id,"im_extvalidREEmail");
							else
								validateInputRE(testinput.id,"im_extvalidREpass");
							formError++;
							if(errorOffsetTop>eloffsetTop(testinput.id) || errorOffsetTop==0) errorOffsetTop=eloffsetTop(testinput.id);
						}
					}
					else
						if (testinput.className.indexOf("im_extvalid")!=-1 ) {
							if(!validateInput(testinput.id)){
								formError++;	
								if(errorOffsetTop>eloffsetTop(testinput.id) || errorOffsetTop==0) errorOffsetTop=eloffsetTop(testinput.id);
							}
						}
				
				oldElemen=testinput;
				
				inputInd++;
			}
			
			textareaInd=0;
			while(Checkform.getElementsByTagName('textarea')[textareaInd])
			{			
				var testarea=Checkform.getElementsByTagName('textarea')[textareaInd];						
				
				if (testarea.className.indexOf("im_extvalid")!=-1 ) {
					if(!validateInput(testarea.id)){
						formError++;		
						if(errorOffsetTop>eloffsetTop(testarea.id) || errorOffsetTop==0) errorOffsetTop=eloffsetTop(testarea.id);
					}
				}
				if(editorMY && editorMY[testarea.id])
					editorMY[testarea.id].loadContentFromField();
				textareaInd++;
			}	
			
			selectInd=0;
			while(Checkform.getElementsByTagName('select')[selectInd])
			{			
				var testselect=Checkform.getElementsByTagName('select')[selectInd];						
				
				if (testselect.className.indexOf("im_extvalid")!=-1 ) {
					if(!validateInput(testselect.id)){
						formError++;			
						if(errorOffsetTop>eloffsetTop(testselect.id) || errorOffsetTop==0) errorOffsetTop=eloffsetTop(testselect.id);
					}
				}
				
				selectInd++;
			}
		
			if(flocaltime==0){
				var newHin=document.createElement('input');
				
				newHin.setAttribute('id','flocalltime');
				newHin.setAttribute('name','flocalltime');
				newHin.setAttribute('type',"hidden");
				Checkform.appendChild(newHin);
			}
			var timeLn=new Date();
		
			$('#flocalltime').val(dateFormat(timeLn, "yyyy-mm-dd HH:MM:ss"));
		}
		
		
		
		if(formError==0){
			checkFormDefaulttextNone(oCheckformId);
			return true;
		}
		else{
			if(errorOffsetTop!=0 && !winpos){	
				winh=$(window).height();
				//alert(errorOffsetTop);
				scrolltopH=errorOffsetTop-parseInt(winh/2);
				if(scrolltopH<0)
					scrolltopH=scrolltopH*(-1);
				if(scrolltopH<errorOffsetTop)
				window.scrollTo(0,scrolltopH);
			}
			
			return false;
		}
	}
	
	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 setCookie(c_name,value,expiredays)
	{
		var path;	
		if(vsubpath2=='')
			path='/';
		else
			path=vsubpath2+'/';
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+expiredays);
		document.cookie=c_name+ "=" +escape(value)+
		((expiredays==null) ? "" : ";expires="+exdate.toGMTString())+
		";path="+path;
	}
	
	var oldsel=[];	
	var lenchcolor1=[];
	var lenchcolor2=[];
	var lenchcolor3=[];
	var disableover=[];
	
	function createMenu(code,class1,class2){
		lenchcolor1[code]=class1;
		lenchcolor2[code]=class2;
		lenchcolor3[code]=class1;
		oldsel[code]=-1;
		oldsel[code+'id']='';
		disableover[code]=[];
		//getCookie(code);
	}
	
	function adddisable(code,id){
		disableover[code][id]='yes';
	}
	
	
	function reqLenFunc(otype,oele,oid,ocode){
		
		if(!disableover[ocode])
			disableover[ocode]=[];
		if(!oele.id){
			oele=document.getElementById(oele);
		}
		
		var jsTRid;
		jsTRid=ocode+oldsel[ocode];
		fspea=oid*1;
		nspea=oid*1+1;
		
		cur_fspea=oldsel[ocode]*1;
		cur_nspea=oldsel[ocode]*1+1;
				
		if(otype=='over'){
		
			if(oele.id!=jsTRid){
					
				if(disableover[ocode][oid]!='yes')	
					$('#'+oele.id).addClass(lenchcolor1[ocode]);
		
				$('#'+ocode+'spea_'+fspea).addClass(ocode+'spea0_sel');
				$('#'+ocode+'spea_'+nspea).addClass(ocode+'spea0_sel');
				
			}
			
			if(oldsel[ocode]!=0){
				$('#over_'+jsTRid).hide();
			}
	
			$('#over_'+oele.id).show();
		}
		
		
		if(otype=='out'){
			
			if( oele.id!=jsTRid){
				if(disableover[ocode][oid]!='yes')
					$('#'+oele.id).removeClass(lenchcolor1[ocode]);

				$('#'+ocode+'spea_'+fspea).removeClass(ocode+'spea0_sel');
				$('#'+ocode+'spea_'+nspea).addClass(ocode+'spea0_sel');	
			}
			
			$('#over_'+oele.id).hide();
		}
		
		if(otype=='click' || otype=='click2'){
			
			if(oldsel[ocode]!=0){
				
				if(document.getElementById(jsTRid) && disableover[ocode][oldsel[ocode]]!='yes'){
					$('#'+jsTRid).removeClass(lenchcolor3[ocode]);	
				}
				$('#body_'+jsTRid).hide();
			}
			
	
			$('#'+ocode+'spea_'+fspea).addClass(ocode+'spea0_sel');
	
			$('#'+ocode+'spea_'+nspea).addClass(ocode+'spea0_sel');
				
			oldsel[ocode]=oid;

			setCookie(ocode,oid,1);
	
			if(disableover[ocode][oid]!='yes')
				$('#'+oele.id).addClass(lenchcolor3[ocode]);
		
			if(otype=='click2' && oele.getElementsByTagName('a')[0]){
				var ahref=oele.getElementsByTagName('a')[0].href;
				
				if(ahref.split('javascript')!=-1){
					window.location.href=ahref;
				}
			}
			
			$('#body_'+oele.id).show();

		}
		
	}
	
	function trim(stringToTrim) {
		return stringToTrim.replace(/^\s+|\s+$/g,"");
	}
	function ltrim(stringToTrim) {
		return stringToTrim.replace(/^\s+/,"");
	}
	function rtrim(stringToTrim) {
		return stringToTrim.replace(/\s+$/,"");
	}
	
	function resetFormEl(id){
		$('#'+id).removeClass('im_errorValid');
		$('#err_'+id).removeClass('b_errorValid');	
		$('#err_'+id).removeClass('b_successValid');
		var text=$('#errT_'+id).html();
		if(text!=null)
		$('#errT_'+id).html(text.split(' is required')[0]);
	}
	
	function formReset(id){
		document.getElementById(id).reset();

		var Checkform=document.getElementById(id);
		if(Checkform){
			inputInd=0;		
			while(Checkform.getElementsByTagName('input')[inputInd]){
				var testinput=Checkform.getElementsByTagName('input')[inputInd];
				if(testinput.id)
				resetFormEl(testinput.id);
				inputInd++;
			}
			
			textareaInd=0;
			while(Checkform.getElementsByTagName('textarea')[textareaInd]){		
				var testarea=Checkform.getElementsByTagName('textarea')[textareaInd];			
				if(testarea.id)
				resetFormEl(testarea.id);
				textareaInd++;
			}	
			
			selectInd=0;
			while(Checkform.getElementsByTagName('select')[selectInd]){	
				var testselect=Checkform.getElementsByTagName('select')[selectInd];	
				if(testselect.id)
				resetFormEl(testselect.id);
				selectInd++;
			}	
		}
	}
	
	function validateClassChange(bool,el,id){
		var text=$('#errT_'+id).html();
		
		if(!bool){
			//if (el.className.indexOf("im_errorValid")==-1 ) {
				 $('#'+id).addClass('im_errorValid');	
				
				// $('#err_'+id).addClass('b_errorValid');
				
				 
				 if(text!=null && text.indexOf('is required')==-1)
				 $('#errT_'+id).html(text+' is required');
			//}
			
			if (el && el.className.indexOf("blfoarea")!=-1 && el.className.indexOf("im_e")!=-1 ) {
				//$('#err_'+id).removeClass('b_successValid');
				
				$('#'+id).parent().addClass("blfoareaErr");
				$('#'+id).parent().removeClass("blfoareaSuc");
			}
		}
		else{
			//if (el.className.indexOf("im_errorValid")!=-1 ) {
				$('#'+id).removeClass('im_errorValid');
				//$('#err_'+id).removeClass('b_errorValid');
				
				
				if(text!=null) 
				$('#errT_'+id).html(text.split(' is required')[0]);
			//}
			
			if (el && el.className.indexOf("blfoarea")!=-1 && el.className.indexOf("im_e")!=-1 ) {
				//$('#err_'+id).addClass('b_successValid');
				$('#'+id).parent().removeClass("blfoareaErr");
				$('#'+id).parent().addClass("blfoareaSuc");
			}
			
		}
	}
	
	function validateEmail(email) {
	   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;

	   var address = document.getElementById(email);
	   var address2 = trim(document.getElementById(email).value);
	   if(reg.test(address2) == false) {	   
		  validateClassChange(false,address,email); 
		  return false;
	   }
	   else{
		   validateClassChange(true,address,email); 
		   $('#'+email).val(address2);
	   	   return true;
	   }
	}
	
	function validateInputRE(oid,oclass){
		var address = document.getElementById(oid);
		validateClassChange(false,address,oid);
	}
	
	function validateEmailImg(email,email2){
		if(validateEmail(email))
			$('#'+email2).html('<img src="'+vsubpath+'/img/Tick.png" border="0" width="16" height="16" />'); 
		else 
			$('#'+email2).html('<img src="'+vsubpath+'/img/Delete.png" border="0" width="16" height="16" />'); 
	}
	
	function validateEmailImg2(email,email2,email1){
		
		if(validateEmail(email1)){

			if(document.getElementById(email1).value==document.getElementById(email).value)
				$('#'+email2).html("<img src='"+vsubpath+"/img/Tick.png' border=0 width=16 height=16 />"); 
			else
				$('#'+email2).html("<img src='"+vsubpath+"/img/Delete.png' border=0 width=16 height=16 />");
		}
		else 
			$('#'+email2).html("<img src='"+vsubpath+"/img/Delete.png' border=0 width=16 height=16 />");	
	}
	
	function validatePassRE(input1,input2){
		
		var address = document.getElementById(input2);
		if(document.getElementById(input1).value!='' && document.getElementById(input1).value==document.getElementById(input2).value){
			validateClassChange(true,address,input2);
		}
		else{
			validateClassChange(false,address,input2);
		}		
	}
	
	function validateInput(email) {
	  
	   if(document.getElementById(email)){
		   var address = document.getElementById(email);
		   
		   if(address.value=='' || address.value==address.title) {
			  validateClassChange(false,address,email);
			  return false;
		   }
		   else{
			  validateClassChange(true,address,email);
			  return true;
		   }
	   }
	   
	   return true
	}
	
	function remainingtext(id,num){
		
		var rcount=num,chText=$('#'+id).val(),chTextnum=chText.length;
		
		if(chText.length>num){
			rcount=0;	
			
			$('#'+id).val(chText.substr(0,num));
		}
		else{
			rcount=num-chTextnum;	
		}
		
		$('#'+id+'_remaining').html(rcount);
	}


	function moveform(oformId,toformId){
	
		var fromform=document.getElementById(oformId);
		var toForm=document.getElementById(toformId);
		if(fromform && toForm)
		{
			inputInd=0;	
			while(fromform.getElementsByTagName('input')[inputInd])
			{
				var chel=fromform.getElementsByTagName('input')[inputInd];		
				if(chel.type=='text' || chel.type=='hidden'){	
					
					var newinput = document.createElement('input');				
					newinput.setAttribute('id',chel.id);
					newinput.setAttribute('name',chel.name);
					newinput.setAttribute('type',"hidden");
					newinput.value = chel.value;
					toForm.appendChild(newinput);
				}
				inputInd++;
			}
			textareaInd=0;
			while(fromform.getElementsByTagName('textarea')[textareaInd])
			{		
				var chel=fromform.getElementsByTagName('textarea')[textareaInd];	
				var newinput = document.createElement('input');				
				newinput.setAttribute('id',chel.id);
				newinput.setAttribute('name',chel.name);
				newinput.setAttribute('type',"hidden");
				newinput.value = chel.value;
				toForm.appendChild(newinput);
				textareaInd++;
			}
			selectInd=0;
			while(fromform.getElementsByTagName('select')[selectInd])
			{		
				var chel=fromform.getElementsByTagName('select')[selectInd];	
				var newinput = document.createElement('input');				
				newinput.setAttribute('id',chel.id);
				newinput.setAttribute('name',chel.name);
				newinput.setAttribute('type',"hidden");
				newinput.value = chel.value;
				toForm.appendChild(newinput);
				selectInd++;
			}
		}
		
	}
	
	
	Global = {
FixPng: function( img ){
if(document.all){
img.parentNode.style.width = img.offsetWidth;
img.parentNode.style.height = img.offsetHeight;
img.parentNode.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src='"+ img.src +"')"
} else {
img.style.visibility = "visible"
}
},

FixPng2: function(img){
	if(document.getElementById(img)){
		var tEl=document.getElementById(img);
		if(document.all){
			tEl.className=tEl.className+'IE';
		}
		else{
		}
	}
}

}

	function pageRefreshLoad(getPageUrl,wtime){
			$.get(vsubpath+'/ajax/refresh.php',function(data) {pageRefresh(getPageUrl,wtime); });
	}
	
	
	function pageRefresh(getPageUrl,wtime){
		setTimeout("pageRefreshLoad('"+getPageUrl+"','"+wtime+"')",wtime);
		
	}
	
	
	function pageRefresh2(getPageUrl){
	
		setTimeout("window.location.href='"+getPageUrl+"'",'1380000');	
	}
	
	
	var msgwin='none',mswgwinHeight=90,topAposition=0;
	function msgAlertClose(){
		var newPos=topAposition+"px";	
		//  && document.getElementById("topAlertDIV").style.top==newPos
		if(msgwin=="block"){
			//var newPos2=mswgwinHeight*1+topAposition*1;	
	
			$("#topAlertDIV").animate({"top": "-="+mswgwinHeight+"px"}, "slow");
			//document.getElementById("topAlertDIV").style.display="none";
			msgwin='none';
		}
	}
	
	function tcMsgShow(){
		/*window.scrollTo(0,120);*/
		
		topAposition=document.documentElement.scrollTop;
		if(topAposition==0)
			topAposition = getCookie('topPos');
			
		if(document.getElementById("topAlertDIV")){
		
			mswgwinHeight=$('#topAlertDIV').outerHeight()*1+62;
			
			
			if(msgwin=="none" ){
			
				
				//var newPos=topAposition*1-mswgwinHeight*1;	
				var newPos=mswgwinHeight*(-1);	
				//document.getElementById("topAlertDIV").style.top=newPos+"px";
				
				$('#topAlertDIV').css('top',newPos+"px");
				//document.getElementById("topAlertDIV").style.display="block";
				$('#topAlertDIV').show();
				
				$("#topAlertDIV").animate({"top": "+="+mswgwinHeight+"px"}, "slow");
				msgwin='block';
				setTimeout("msgAlertClose()",10000);
				
			}
		}
	}
	
	
	function tconload(){
		  var top_position = getCookie('topPos');
	
		  window.scrollTo(0,top_position);
	}
	
	function tconunload(){
		//var top_position = document.documentElement.scrollTop;
		var top_position = $(window).scrollTop();
		setCookie('topPos',top_position,1);
	}
	
	var winLastPos=0;
	
	function tempBoxOpen(){
		
		
		selectInd=0;
		while(document.getElementsByTagName('select')[selectInd])
		{			
			var testselect=document.getElementsByTagName('select')[selectInd];						
			
			testselect.style.visibility='hidden';
			selectInd++;
		}

		//var top_position = document.documentElement.scrollTop;	
		
		var top_position = $(window).scrollTop(),whe=$(window).height()*1,wheWTH=$(window).width()*1,hhe=400;

		if(whe>hhe){
			winLastPos2=top_position*1+parseInt((whe-hhe)/2);
		}
		else
			winLastPos2=top_position*1;
			
		winLastPos2=top_position*1-80;	
		
		//wheWTH2=parseInt((wheWTH-530)/2);

		//$('#ajaxABDIV').css('left',wheWTH2+'px');
		//$('#ajaxABDIV').css('left','235px');
		$('#ajaxABDIV').css('top',winLastPos2+'px');
		
		$('#ajaxABDIV').css('display','block');
		$('#ep-genMSG56').css('height',$('#filebodyTDmainIndex').outerHeight()+'px');
		$('#ep-genMSG56').css('display','block');
		
		homeDialogBox=true;
	}
	
	function tempBoxClose(){
		
		selectInd=0;
		while(document.getElementsByTagName('select')[selectInd])
		{			
			var testselect=document.getElementsByTagName('select')[selectInd];						
			
			testselect.style.visibility='visible';
			selectInd++;
		}
		
		$('#ajaxABDIV').css('display','none');
		$('#ep-genMSG56').css('display','none');
		winLastPos=0;
	}
	
	
	function windowLang(){
		tempBoxOpen();
		
		$('#ajaxABHOMEDIVBody').html("<p><img src='"+vsubpath+"/img/ajax-loader2.gif' border='0'  align=absmiddle></p>");
  		$('#ajaxABHOMEDIVBody').load(""+vsubpath+"/ajax/lang.php");
	}
	
	function setAddLocationHref(addUrl,addVal){
		if (window.location.href.indexOf(addUrl+"=")!=-1 ){ 
			var fiurl=window.location.href.split(addUrl+"="),clnewurl=fiurl[0];
			
			if(fiurl[1].indexOf('&')!=-1){
				var fiurl2=fiurl[1].split("&");
				clnewurl=clnewurl+addUrl+'='+addVal+'&'+fiurl2[1];
			}
			else
				clnewurl=clnewurl+addUrl+'='+addVal;
			
			window.location.href=clnewurl;
		}
		else
		if (window.location.href.indexOf("?")!=-1 ){ 
			if(window.location.href.split("?")[1].indexOf("#")!=-1){
				window.location.href=window.location.href.split("#")[0]+'&'+addUrl+'='+addVal+'#'+window.location.href.split("#")[1];
			}
			else
				window.location.href=window.location.href+'&'+addUrl+'='+addVal;
		}
		else{
			if(window.location.href.indexOf("#")!=-1)
				window.location.href=window.location.href.split("#")[0]+'?'+addUrl+'='+addVal+'#'+window.location.href.split("#")[1];
			else
				window.location.href=window.location.href+'?'+addUrl+'='+addVal;
		}	
	}
	
	
/*
 * Date Format 1.2.3
 * (c) 2007-2009 Steven Levithan <stevenlevithan.com>
 * MIT license
 *
 * Includes enhancements by Scott Trenda <scott.trenda.net>
 * and Kris Kowal <cixar.com/~kris.kowal/>
 *
 * Accepts a date, a mask, or a date and a mask.
 * Returns a formatted version of the given date.
 * The date defaults to the current date/time.
 * The mask defaults to dateFormat.masks.default.
 */


var dateFormat = function () {
	var	token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
		timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
		timezoneClip = /[^-+\dA-Z]/g,
		pad = function (val, len) {
			val = String(val);
			len = len || 2;
			while (val.length < len) val = "0" + val;
			return val;
		};

	// Regexes and supporting functions are cached through closure
	return function (date, mask, utc) {
		var dF = dateFormat;

		// You can't provide utc if you skip other args (use the "UTC:" mask prefix)
		if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
			mask = date;
			date = undefined;
		}

		// Passing date through Date applies Date.parse, if necessary
		date = date ? new Date(date) : new Date;
		if (isNaN(date)) throw SyntaxError("invalid date");

		mask = String(dF.masks[mask] || mask || dF.masks["default"]);

		// Allow setting the utc argument via the mask
		if (mask.slice(0, 4) == "UTC:") {
			mask = mask.slice(4);
			utc = true;
		}

		var	_ = utc ? "getUTC" : "get",
			d = date[_ + "Date"](),
			D = date[_ + "Day"](),
			m = date[_ + "Month"](),
			y = date[_ + "FullYear"](),
			H = date[_ + "Hours"](),
			M = date[_ + "Minutes"](),
			s = date[_ + "Seconds"](),
			L = date[_ + "Milliseconds"](),
			o = utc ? 0 : date.getTimezoneOffset(),
			flags = {
				d:    d,
				dd:   pad(d),
				ddd:  dF.i18n.dayNames[D],
				dddd: dF.i18n.dayNames[D + 7],
				m:    m + 1,
				mm:   pad(m + 1),
				mmm:  dF.i18n.monthNames[m],
				mmmm: dF.i18n.monthNames[m + 12],
				yy:   String(y).slice(2),
				yyyy: y,
				h:    H % 12 || 12,
				hh:   pad(H % 12 || 12),
				H:    H,
				HH:   pad(H),
				M:    M,
				MM:   pad(M),
				s:    s,
				ss:   pad(s),
				l:    pad(L, 3),
				L:    pad(L > 99 ? Math.round(L / 10) : L),
				t:    H < 12 ? "a"  : "p",
				tt:   H < 12 ? "am" : "pm",
				T:    H < 12 ? "A"  : "P",
				TT:   H < 12 ? "AM" : "PM",
				Z:    utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
				o:    (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
				S:    ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
			};

		return mask.replace(token, function ($0) {
			return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
		});
	};
}();

// Some common format strings
dateFormat.masks = {
	"default":      "ddd mmm dd yyyy HH:MM:ss",
	shortDate:      "m/d/yy",
	mediumDate:     "mmm d, yyyy",
	longDate:       "mmmm d, yyyy",
	fullDate:       "dddd, mmmm d, yyyy",
	shortTime:      "h:MM TT",
	mediumTime:     "h:MM:ss TT",
	longTime:       "h:MM:ss TT Z",
	isoDate:        "yyyy-mm-dd",
	isoTime:        "HH:MM:ss",
	isoDateTime:    "yyyy-mm-dd'T'HH:MM:ss",
	isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
};

// Internationalization strings
dateFormat.i18n = {
	dayNames: [
		"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
		"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
	],
	monthNames: [
		"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
		"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
	]
};

// For convenience...
Date.prototype.format = function (mask, utc) {
	return dateFormat(this, mask, utc);
};
	
	var nowCD = new Date(); 
	var ntimeCD=dateFormat(nowCD, "yyyy-mm-dd HH:MM:ss"); 
	var ntimeCZ=dateFormat(nowCD, "o"); 
	



	
	function loadmaskDiv(){

		$('#ep-genMSG59').css('height',$('#filebodyTDmainIndex').height()+'px');
		$('#ep-genMSG59').show();
		$('#ep-genMSG59').html("<div style='margin:150px 49%;'><img src='"+vsubpath+"/img/ajax-loader2.gif' border='0' ></div>");
	}
	
	function loadmaskDivHide(){
		$('#ep-genMSG59').hide();
	}
	
	function itemoverout(type,id,el,oclass){
		//$('#testhis').html(oclass);
		if(type=='over'){
			$('#'+el.id).addClass(oclass);
			
		}
		else{
			$('#'+el.id).removeClass(oclass);
			
		}
		
	}
	
	

	
	var ie=false;
	
	
	function showComment(userid,comid,type){
		
		if(type=='dialog'){
			tempBoxOpen();
		
			$('#ajaxABHOMEDIVBody').html("<p><img src='"+vsubpath+"/img/ajax-loader2.gif' border='0'  align=absmiddle></p>");
			$('#ajaxABHOMEDIVBody').load(vsubpath+"/ajax/addcomment.php?id="+comid+'&userid='+userid);	
		}
		else{
			tempBoxOpen();
		
			$('#ajaxABHOMEDIVBody').html("<p><img src='"+vsubpath+"/img/ajax-loader2.gif' border='0'  align=absmiddle></p>");
			$('#ajaxABHOMEDIVBody').load(vsubpath+"/ajax/rescomment.php?id="+comid+'&userid='+userid);		
		}
	}
	
	

	
	function delComment(comid,id,type){
		tempBoxOpen();
		
		$('#ajaxABHOMEDIVBody').load(vsubpath+"/ajax/alert.php?f=cencel"+type+"&id="+id+"&t="+type+"&comid="+comid);
		$('#btn_confirm').focus();
	}

	function tabLinkSlide(id){
		window.scrollTo(0,0);	
		if(typeof loadTAbContent == 'function')	
			loadTAbContent(id);
		else
			window.location.href=vsubpath+'/main/?f=pages#'+id;
	}


	function itemoveroutEv(type,id,el,oclass){
			
		if(type=='over'){
			//$('#'+el.id).addClass(oclass);	
			$('#delBut'+el.id).show();
			$('#delButRes'+el.id).show();
		}
		else{
			//$('#'+el.id).removeClass(oclass);
			$('#delBut'+el.id).hide();
			$('#delButRes'+el.id).hide();
		}
	}
	
	

	
	
	
	var inetMpVpCurPage = [];
	var inetMpVpLastPage = [];
	var inetMpVpLastType = [];
	var inetMpVpLock = [];

	var MpVpNum=[];
	var MpVpWidth=[];
	var MpVpTitleWidth=[];
	var MpVpimg=[];
	var MpVpNew=[];
	var inetMpVpTitleHeight = [];
	var MpPrev=[];
	var MpNext=[];
	var MpStartLeft=[];

	var showpageN='';
	
	function inetSliderInit(code,width,imgnum,index,height,bg,left,width2){
		MpVpWidth[code]=width*1;
		MpVpTitleWidth[code]=width2*1;
		MpVpNum[code]=imgnum*1;	
		MpVpimg[code]=imgnum*1;
		inetMpVpCurPage[code] = index*1;
		inetMpVpLastPage[code] = 0;
		inetMpVpLastType[code] = 'left';
		inetMpVpLock[code] = false;
		inetMpVpTitleHeight[code] = height*1;
		MpVpNew[code]=bg;
		MpPrev[code]=[];
		MpNext[code]=[];
		MpStartLeft[code]=left;
	}
	
	function inetMpVpBlur( lnk ) {
		try {
			lnk.blur();
		} catch(e) {};
	}
	
	function inetMpVpNext( lnk , code) {
		inetMpVpBlur( lnk );
		if((inetMpVpCurPage[code] < MpVpNum[code])&&(!inetMpVpLock[code])) {
			inetMpVpSlideLeft(code);
		}
		else{
			if((inetMpVpCurPage[code] == MpVpNum[code])&&(!inetMpVpLock[code])) {
				inetMpVpPage(1,document.getElementById('inetMpVid'+code+'ADot1'),code);
			}
		}
	}
	
	function inetMpVpPrev( lnk , code) {
		inetMpVpBlur( lnk );
	
		if((inetMpVpCurPage[code] > 1)&&(!inetMpVpLock[code])) {
			inetMpVpSlideRight(code);	
		}
		else
			if((inetMpVpCurPage[code] == 1)&&(!inetMpVpLock[code])) {
				inetMpVpPage(MpVpNum[code],document.getElementById('inetMpVid'+code+'ADot1'),code);	
			}
	}

	function inetMpVpPage( intPage, lnk , code) {
		
		inetMpVpBlur( lnk );
	
		if((inetMpVpCurPage[code] != intPage)&&(!inetMpVpLock[code])) {
			
			
			if(inetMpVpCurPage[code] < intPage) {
				if((intPage - inetMpVpCurPage[code]) > 1) {
					inetMpVpSlideSelect(intPage,code,'left');
				}
				else {
					inetMpVpSlideLeft(code);
				}
			}
			else {
				if((inetMpVpCurPage[code] - intPage) > 1) {
					//cnnMpVpSlideDoubleRight();
					inetMpVpSlideSelect(intPage,code,'right')
				}
				else {
					inetMpVpSlideRight(code);
				}
			}
		}
	}

	function inetLockMpVp( intDur,code ) {
		
		var inetLockDur = 500;
		inetMpVpLock[code] = true;
		if(document.getElementById('dn_pageLoad'+code+'DIV'))
			document.getElementById('dn_pageLoad'+code+'DIV').innerHTML='<img src="'+vsubpath+'/img/blackLoading.gif" />';
		if(document.getElementById('dn_pageLoad'+code+'DIV2'))
			document.getElementById('dn_pageLoad'+code+'DIV2').innerHTML='<img src="'+vsubpath+'/img/ajax-loader.gif" />';

		setTimeout(function() { 
			
			
				inetMpVpLock[code] = false;
			if(document.getElementById('dn_pageLoad'+code+'DIV'))
			document.getElementById('dn_pageLoad'+code+'DIV').innerHTML=''; 
			if(document.getElementById('dn_pageLoad'+code+'DIV2'))
			document.getElementById('dn_pageLoad'+code+'DIV2').innerHTML=''; 
			if(document.getElementById('inetMpVid'+code+'NUM1'))
				document.getElementById('inetMpVid'+code+'NUM1').innerHTML=inetMpVpCurPage[code]+'/'+MpVpNum[code];
			if(document.getElementById('inetMpVid'+code+'NUM2'))
				document.getElementById('inetMpVid'+code+'NUM2').innerHTML=inetMpVpCurPage[code]+'/'+MpVpNum[code];	
			
			setMpBg(code,inetMpVpLastPage[code],'set',inetMpVpLastType[code]);
			
			},inetLockDur);
	}
	
	function setMpBg(code,nowind,type,type2){
		if(MpVpNew[code]){
			curInd=nowind-1;
			if(curInd<0)
				curInd=MpVpNum[code]-1;
			
			nextInd=nowind+1;
			if(nextInd>=MpVpNum[code])
				nextInd=0;
			if( type2=='right'){
				pind=-1;
				pind2=1;
				pk='-';
			}
			else{
				pind=1;
				pind2=-1;
				pk='+';
			}
			
			mLeft=0;
			mLeft2=0;
			leftW=MpVpWidth[code]/2;
			
			if(type=='back' && MpPrev[code]){
				mLeft=MpPrev[code][curInd];
				mLeft2=MpNext[code][nextInd];
				
				MpPrev[code][curInd]=0;
				MpNext[code][nextInd]=0;
			}
			else
			if(type=='set' && document.getElementById('in_box'+code+'DIV'+nowind)){
				
				mLeft2=leftW*pind;
				mLeft=leftW*pind2;
				if(document.getElementById('in_box'+code+'DIV'+curInd)){
					MpPrev[code][curInd]=document.getElementById('in_box'+code+'DIV'+curInd).style.left.split('px')[0]*1;
				}
				if(document.getElementById('in_box'+code+'DIV'+nextInd)){
					MpNext[code][nextInd]=document.getElementById('in_box'+code+'DIV'+nextInd).style.left.split('px')[0]*1;
				}
			}
			
	
			if(document.getElementById('in_box'+code+'DIV'+curInd) && curInd!=nowind && mLeft!=0){
				document.getElementById('in_box'+code+'DIV'+curInd).style.left=mLeft+'px';
				
			}
			
			if(document.getElementById('in_box'+code+'DIV'+nextInd) && nextInd!=nowind && mLeft2!=0){
				document.getElementById('in_box'+code+'DIV'+nextInd).style.left=mLeft2+'px';
			}
		}
	
	}
	
	function updateDesc(code,currentind,nowind){
		//setMpBg(code,nowind,'set','left');
		
		if(MpVpNew[code]){
			$('#in_box'+code+'DIV'+currentind).removeClass('selected');
			if(inetMpVpTitleHeight[code] && inetMpVpTitleHeight[code]>0 && document.getElementById('inet_'+code+'Title_'+currentind) && document.getElementById('inet_'+code+'Title_'+currentind).className.indexOf('blocked')!=-1){
				
				moveintV=document.getElementById('inet_'+code+'Title_'+currentind).style.top.split('px')[0]*1+inetMpVpTitleHeight[code];	
				document.getElementById('inet_'+code+'Title_'+currentind).style.top=moveintV+'px';
				
				$('#inet_'+code+'Title_'+currentind).removeClass('blocked');
			}
				
			if(inetMpVpTitleHeight[code] && inetMpVpTitleHeight[code]>0 && document.getElementById('inet_'+code+'Title_'+nowind) && document.getElementById('inet_'+code+'Title_'+nowind).className.indexOf('blocked')==-1){
					document.getElementById('inet_'+code+'Title_'+nowind).style.left = "0px";
					//alert(document.getElementById('inet_'+code+'Title_'+nowind).style.top);
					moveintV=document.getElementById('inet_'+code+'Title_'+nowind).style.top.split('px')[0]*1-inetMpVpTitleHeight[code];
					document.getElementById('inet_'+code+'Title_'+nowind).style.top = moveintV+"px";
	
			}
			$('#in_box'+code+'DIV'+nowind).addClass('selected');
			$('#inet_'+code+'Title_'+nowind).addClass('blocked');
		}
	}
	
	function inetMpslideAnimate(code,saveSW2,mPage2,saveSW1,mPAge){
		if(saveSW2!=0){
			$('#in_box'+code+'DIV'+mPage2).animate({"left": "+="+saveSW2+"px"}, 300);
		}
		if(saveSW1!=0){
			$('#in_box'+code+'DIV'+mPAge).animate({"left": "+="+saveSW1+"px"}, 300);
		}	
	}
	
	function inetMpVpSlideLeft(code) {
		
		inetLockMpVp(MpVpimg[code],code);
		
		mPAge=inetMpVpCurPage[code];
		mPage2=inetMpVpCurPage[code]-1;
		
		setMpBg(code,mPage2,'back','left');
		saveSW1=0;
		saveSW2=0;
		for(j=0;j<MpVpNum[code];j++){
			setmpW=MpVpWidth[code]*(-1);	
			
			if(mPAge==j || mPage2==j){
					
				if(mPAge==j){
					saveSW1=setmpW;
				}
				else
					saveSW2=setmpW;
			}
			else{
				if(document.getElementById('in_box'+code+'DIV'+j)){
					moveintV=document.getElementById('in_box'+code+'DIV'+j).style.left.split('px')[0]*1+setmpW;	
					document.getElementById('in_box'+code+'DIV'+j).style.left=moveintV+'px';
				}
			}
		}
		inetMpVpLastPage[code]=mPAge;
		inetMpVpLastType[code]='left';
		
		inetMpslideAnimate(code,saveSW2,mPage2,saveSW1,mPAge)
		
		updateDesc(code,mPage2,mPAge);
		
		inetMpVpCurPage[code]++;
		inetMpVpMoveDot(code);
		inetMpVpUpdateBtns(code);
	}
	
	function inetMpVpSlideRight(code) {
		inetLockMpVp(MpVpimg[code],code);

		mPAge=inetMpVpCurPage[code]-2;
		mPage2=inetMpVpCurPage[code]-1;
		setMpBg(code,mPage2,'back','left');
		saveSW1=0;
		saveSW2=0;
		for(j=0;j<MpVpNum[code];j++){
			setmpW=MpVpWidth[code]*(-1);
			if(mPAge==j || mPage2==j){
				
				if(mPAge==j){
					saveSW1=MpVpWidth[code];
				}
				else
					saveSW2=MpVpWidth[code];
			}
			else{
				if(document.getElementById('in_box'+code+'DIV'+j)){
					moveintV=document.getElementById('in_box'+code+'DIV'+j).style.left.split('px')[0]*1+MpVpWidth[code]*1;
					document.getElementById('in_box'+code+'DIV'+j).style.left=moveintV+'px';
				}
			}
		}
		inetMpVpLastPage[code]=mPAge;
		inetMpVpLastType[code]='left';
		//setMpBg(code,mPAge,'set','left');
		inetMpslideAnimate(code,saveSW2,mPage2,saveSW1,mPAge)
		updateDesc(code,mPage2,mPAge);
		
		inetMpVpCurPage[code]--;
		inetMpVpMoveDot(code);
		inetMpVpUpdateBtns(code);
	}
	
	function inetMpVpSlideSelect(intPage,code,type) {
				
		if(type=='left'){
			indexT=-1;
			moveint=intPage - inetMpVpCurPage[code];
			moveint2=intPage - 1 - inetMpVpCurPage[code];
		}
		else{
			indexT=1;
			moveint=inetMpVpCurPage[code] - intPage;
			moveint2=inetMpVpCurPage[code] - intPage-1;
		}
		
		lockint=MpVpimg[code]*moveint;
		
		inetLockMpVp(MpVpimg[code],code);
		widthint=MpVpimg[code]*moveint;
		durint=0.3*moveint;
		mPAge=intPage-1;
		mPage2=inetMpVpCurPage[code]-1;
		
		setMpBg(code,mPage2,'back',type);
		saveSW1=0;
		saveSW2=0;
		for(j=0;j<MpVpNum[code];j++){
			setmpW=MpVpWidth[code]*indexT*moveint;
			
			if(mPAge==j || mPage2==j){
	
				if(mPAge==j){

					saveSW1=MpVpWidth[code]*indexT*moveint2;
					if(document.getElementById('in_box'+code+'DIV'+j)){
						moveintV=document.getElementById('in_box'+code+'DIV'+j).style.left.split('px')[0]*1+saveSW1;
						document.getElementById('in_box'+code+'DIV'+j).style.left=moveintV+'px';
					}
					saveSW1=MpVpWidth[code]*indexT;
				}
				else{
			
					saveSW2=setmpW;
				}
				
			}
			else{
				if(document.getElementById('in_box'+code+'DIV'+j)){
					moveintV=document.getElementById('in_box'+code+'DIV'+j).style.left.split('px')[0]*1+setmpW;	
					document.getElementById('in_box'+code+'DIV'+j).style.left=moveintV+'px';
				}
			}
		}
		inetMpVpLastPage[code]=mPAge;
		inetMpVpLastType[code]=type;
		//setMpBg(code,mPAge,'set',type);
		inetMpslideAnimate(code,saveSW2,mPage2,saveSW1,mPAge)
		
		updateDesc(code,mPage2,mPAge);
			
		if(type=='left'){
			inetMpVpCurPage[code]=inetMpVpCurPage[code]+moveint;
		}
		else{
			inetMpVpCurPage[code]=inetMpVpCurPage[code]-moveint;
		}
		inetMpVpMoveDot(code);
		inetMpVpUpdateBtns(code);
	}
	
	
	function inetMpDotMouseOver( id ) {
		if(document.getElementById(id))
		document.getElementById(id).src = vsubpath+'/img/main/status1.jpg';
		//$(id).src = vsubpath+'/img/main/status1.jpg';
	}
	
	function allImageLoadInet(code){
		
		mydivindsho=inetMpVpCurPage[code]-1;
	
		for(jf=mydivindsho;jf<=MpVpNum[code];jf++){
	
			if(document.getElementById('in_box'+code+'DIV'+jf)){
				
				inetImgind=0;
				var searchdivs=document.getElementById('in_box'+code+'DIV'+jf);
				while(searchdivs.getElementsByTagName('img')[inetImgind]){
					if(searchdivs.getElementsByTagName('img')[inetImgind].src.indexOf(vsubpath+"/img/s.gif#")!= -1){
	
						var imgEle=searchdivs.getElementsByTagName('img')[inetImgind];
						imgEle.id="loadImg"+jf;
						$('<img src="'+imgEle.src.split(vsubpath+"/img/s.gif#")[1]+'" alt="Loading ..." width="'+$("#loadImg"+jf).attr('width')+'" height="'+$("#loadImg"+jf).attr('height')+'"  >').insertBefore("#loadImg"+jf);
	
						$("#loadImg"+jf).remove();
						
						
					}
					inetImgind++;
				}
			}
		}
	}
	
	
	function inetMpVpMoveDot(code) {
		setCookie(code,inetMpVpCurPage[code],1);
		mydivindsho=inetMpVpCurPage[code]-2;
	
		for(jf=mydivindsho;jf<=inetMpVpCurPage[code]+1;jf++){

			if(document.getElementById('in_box'+code+'DIV'+jf)){
				
				inetImgind=0;
				var searchdivs=document.getElementById('in_box'+code+'DIV'+jf);
				while(searchdivs.getElementsByTagName('img')[inetImgind]){
					if(searchdivs.getElementsByTagName('img')[inetImgind].src.indexOf(vsubpath+"/img/s.gif#")!= -1){

						var imgEle=searchdivs.getElementsByTagName('img')[inetImgind];
						imgEle.id="load"+code+"Img"+jf+"_"+inetImgind;
						
						$("#load"+code+"Img"+jf+"_"+inetImgind).wrap('<div id="loadN'+code+'Img'+jf+'_'+inetImgind+'" />');
						
						var nImhtml=$("#loadN"+code+"Img"+jf+"_"+inetImgind).html();
						
						nImhtml=nImhtml.replace(vsubpath+"/img/s.gif#",'');
						
						$("#load"+code+"Img"+jf+"_"+inetImgind).remove();
						
						$("#loadN"+code+"Img"+jf+"_"+inetImgind).html(nImhtml);
	
					}
					inetImgind++;
				}
			}
		}
	
		forint=MpVpNum[code]+1;
		for(i=1;i<forint;i++) {
			
			if(document.getElementById('inetMpVid'+code+'Dot'+i)){
				var scDot=document.getElementById('inetMpVid'+code+'Dot'+i);	
			
				scDot.src = vsubpath+'/img/main/'+code+'status0.jpg';
				scDot.onmouseover = function() {this.src = vsubpath+'/img/main/'+code+'status1.jpg';}
				scDot.onmouseout = function() {this.src = vsubpath+'/img/main/'+code+'status0.jpg';}
			}
			else{
				if(document.getElementById('inetMpVid'+code+'2Dot'+i)){
					var scDot=document.getElementById('inetMpVid'+code+'2Dot'+i);
					scDot.style.borderWidth = 0;
					
				}
				else
					if(document.getElementById('inetMpVid'+code+'3Dot'+i)){	
						$('#inetMpVid'+code+'3Dot'+i).removeClass('in2_boxgalleryPage2');
						$('#inetMpVid'+code+'3Dot'+i).addClass('in2_boxgalleryPage');
					}
			}
		}
		if(document.getElementById('inetMpVid'+code+'Dot'+inetMpVpCurPage[code])){
			var scDot=document.getElementById('inetMpVid'+code+'Dot'+inetMpVpCurPage[code]);	
			scDot.src = vsubpath+'/img/main/'+code+'status1.jpg';
			scDot.onmouseover = function() {}
			scDot.onmouseout = function() {}
		}
		else{
			if(document.getElementById('inetMpVid'+code+'2Dot'+inetMpVpCurPage[code])){		
				var scDot=document.getElementById('inetMpVid'+code+'2Dot'+inetMpVpCurPage[code]);	
				scDot.style.borderWidth=1;			
			}
			else
				if(document.getElementById('inetMpVid'+code+'3Dot'+inetMpVpCurPage[code])){	
		
					$('#inetMpVid'+code+'3Dot'+inetMpVpCurPage[code]).removeClass('in2_boxgalleryPage');
					$('#inetMpVid'+code+'3Dot'+inetMpVpCurPage[code]).addClass('in2_boxgalleryPage2');
				}
		
		}
		
	}
	function inetMpVpUpdateBtns(code) {
		if(document.getElementById('inetMpVid'+code+'BtnL')){
		
			var scLeftButton=document.getElementById('inetMpVid'+code+'BtnL');
			var scLRightButton=document.getElementById('inetMpVid'+code+'BtnR');
			
			if(inetMpVpCurPage[code] > 1) {
				$('#inetMpVid'+code+'BtnL').css('cursor','auto');
				scLeftButton.src = vsubpath+'/img/main/'+code+'leftbtn3.jpg';
				scLeftButton.onmouseover = function() { this.src=vsubpath+'/img/main/'+code+'leftbtn2.jpg'; }
				scLeftButton.onmouseout = function() { this.src=vsubpath+'/img/main/'+code+'leftbtn3.jpg'; }
			}
			else {
				
				$('#inetMpVid'+code+'BtnL').css('cursor','default');
				scLeftButton.src = vsubpath+'/img/main/'+code+'leftbtn1.jpg';
				scLeftButton.onmouseover = function() {}
				scLeftButton.onmouseout = function() {}
			}
		
			if(inetMpVpCurPage[code] < MpVpNum[code]) {
				$('#inetMpVid'+code+'BtnR').css('cursor','auto');
				scLRightButton.src = vsubpath+'/img/main/'+code+'rightbtn3.jpg';
				scLRightButton.onmouseover = function() {this.src = vsubpath+'/img/main/'+code+'rightbtn2.jpg';}
				scLRightButton.onmouseout = function() {this.src = vsubpath+'/img/main/'+code+'rightbtn3.jpg';}
			}
			else {
				
				$('#inetMpVid'+code+'BtnR').css('cursor','default');
				scLRightButton.src = vsubpath+'/img/main/'+code+'rightbtn1.jpg';
				scLRightButton.onmouseover = function() {}
				scLRightButton.onmouseout = function() {}
			}
		}
	
		if(typeof(sliderUpdate)=="function")	
			sliderUpdate(code);
	}
	
	var pollHomeA=[];
	
	function pollResultShow(){
			totCount = 0;
			fullW=200;
			for ( keyVar in pollHomeA ) {
			   totCount = totCount+pollHomeA[keyVar]*1;
			}
			if(totCount>0)
			for ( keyVar in pollHomeA ) {
			   //totCount = totCount+pollHomeA[keyVar]*1;
			   
			   y=parseInt((pollHomeA[keyVar]*1*fullW)/totCount);
			   
			   //x=fullW-y;
			   n=parseInt((pollHomeA[keyVar]*100)/totCount);
			   
			   $('#countpollLine_'+keyVar).html(n+'%');
			   
			  // $('#countpollLine_'+keyVar).animate({"top": "-="+y+"px"}, "slow");
			   $('#namepollLine_'+keyVar).animate({"top": "-="+y+"px"}, "slow");
			}
			
	}
