var strLoginAction = "";
var strErrorMessage = "";
var intIsIframe = "";

/* All js are here */

/*------------ jquery.js ------------*/
/*
 * jQuery 1.2.6 - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
 * $Rev: 5685 $
 */
(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else
return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else
selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
return(this[0].value||"").replace(/\r/g,"");}return undefined;}if(value.constructor==Number)value+='';return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else
this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){var src=target[name],copy=options[name];if(target===copy)continue;if(deep&&copy&&typeof copy=="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)target[name]=copy;}return target;};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object)if(callback.apply(object[name],args)===false)break;}else
for(;i<length;)if(callback.apply(object[i++],args)===false)break;}else{if(length==undefined){for(name in object)if(callback.call(object[name],name,object[name])===false)break;}else
for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&&notxml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else
while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]===elem)return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else
while(elem=second[i++])first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)ret[ret.length]=value;}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!='string')return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else
xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();
/*------------ jquery.js ------------*/

/*------------ ajax_autocomplete.js ------------*/
/* Simple AJAX Code-Kit (SACK) v1.6.1 */
/* ©2005 Gregory Wild-Smith */
/* www.twilightuniverse.com */
/* Software licenced under a modified X11 licence,
   see documentation or authors website for more details */

function sack(file) {
	this.xmlhttp = null;

	this.resetData = function() {
		this.method = "POST";
  		this.queryStringSeparator = "?";
		this.argumentSeparator = "&";
		this.URLString = "";
		this.PostParam = "";
		this.encodeURIString = true;
  		this.execute = false;
  		this.element = null;
		this.elementObj = null;
		this.requestFile = file;
		this.vars = new Object();
		this.responseStatus = new Array(2);
  	};

	this.resetFunctions = function() {
  		this.onLoading = function() { };
  		this.onLoaded = function() { };
  		this.onInteractive = function() { };
  		this.onCompletion = function() { };
  		this.onError = function() { };
		this.onFail = function() { };
	};

	this.reset = function() {
		this.resetFunctions();
		this.resetData();
	};

	this.createAJAX = function() {
		try {
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			try {
				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				this.xmlhttp = null;
			}
		}

		if (! this.xmlhttp) {
			if (typeof XMLHttpRequest != "undefined") {
				this.xmlhttp = new XMLHttpRequest();
			} else {
				this.failed = true;
			}
		}
	};

	this.setVar = function(name, value){
		this.vars[name] = Array(value, false);
	};

	this.encVar = function(name, value, returnvars) {
		if (true == returnvars) {
			return Array(encodeURIComponent(name), encodeURIComponent(value));
		} else {
			this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
		}
	}

	this.processURLString = function(string, encode) {
		encoded = encodeURIComponent(this.argumentSeparator);
		regexp = new RegExp(this.argumentSeparator + "|" + encoded);
		varArray = string.split(regexp);
		for (i = 0; i < varArray.length; i++){
			urlVars = varArray[i].split("=");
			if (true == encode){
				this.encVar(urlVars[0], urlVars[1]);
			} else {
				this.setVar(urlVars[0], urlVars[1]);
			}
		}
	}

	this.createURLString = function(urlstring) {
		if (this.encodeURIString && this.URLString.length) {
			this.processURLString(this.URLString, true);
		}

		if (urlstring) {
			if (this.URLString.length) {
				this.URLString += this.argumentSeparator + urlstring;
			} else {
				this.URLString = urlstring;
			}
		}

		// prevents caching of URLString
		this.setVar("rndval", new Date().getTime());

		urlstringtemp = new Array();
		for (key in this.vars) {
			if (false == this.vars[key][1] && true == this.encodeURIString) {
				encoded = this.encVar(key, this.vars[key][0], true);
				delete this.vars[key];
				this.vars[encoded[0]] = Array(encoded[1], true);
				key = encoded[0];
			}

			urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];
		}
		if (urlstring){
			this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
		} else {
			this.URLString += urlstringtemp.join(this.argumentSeparator);
		}
	}

	this.runResponse = function() {
		eval(this.response);
	}

	this.runAJAX = function(urlstring) {
		if (this.failed) {
			this.onFail();
		} else {
			this.createURLString(urlstring);
			if (this.element) {
				this.elementObj = document.getElementById(this.element);
			}
			if (this.xmlhttp) {
				var self = this;
				if (this.method == "GET") {
					totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
					this.xmlhttp.open(this.method, totalurlstring, true);
				} else {
					this.xmlhttp.open(this.method, this.requestFile, true);
					try {
						this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
					} catch (e) { }
				}

				this.xmlhttp.onreadystatechange = function() {
					switch (self.xmlhttp.readyState) {
						case 1:
							self.onLoading();
							break;
						case 2:
							self.onLoaded();
							break;

						case 3:
							self.onInteractive();
							break;
						case 4:
							self.response = self.xmlhttp.responseText;
							self.responseXML = self.xmlhttp.responseXML;
							self.responseStatus[0] = self.xmlhttp.status;
							self.responseStatus[1] = self.xmlhttp.statusText;						

							if (self.execute) {
								self.runResponse();
							}

							if (self.elementObj) {
								elemNodeName = self.elementObj.nodeName;
								elemNodeName = elemNodeName.toLowerCase();
								if (elemNodeName == "input"
								|| elemNodeName == "select"
								|| elemNodeName == "option"
								|| elemNodeName == "textarea") {
									self.elementObj.value = self.response;
								} else {
									self.elementObj.innerHTML = self.response;
								}
							}
							if (self.responseStatus[0] == "200") {
								self.onCompletion();
							} else {
								self.onError();
							}
							/* These lines were added by Alf Magne Kalleland ref. info on the sack home page. It prevents memory leakage in IE */
							self.URLString = "";
							delete self.xmlhttp['onreadystatechange'];
							self.xmlhttp=null;
							self.responseStatus=null;
							self.response=null;
							self.responseXML=null;
							
							break;
					}
				};

				this.URLString = this.URLString + this.PostParam;
				this.xmlhttp.send(this.URLString);
			}
		}
	};

	this.reset();
	this.createAJAX();
}

function setCss(css){
	if(css=="geo"){
		document.getElementById('autoCompLink').href="css/jmcss.css";
	}
	else{
		document.getElementById('autoCompLink').href="css/jmcss.css";
	}
}

//------------------------------------- END AJAX AUTO COMPLETE ------------------------------//
/*------------ ajax_autocomplete.js ------------*/

/*------------ dhtmlSuite-common.js -------------*/
if(!window.DHTMLSuite)var DHTMLSuite=new Object();
if(!String.trim)String.prototype.trim=function()
{
	return this.replace(/^\s+|\s+$/,'')};
	var DHTMLSuite_funcs=new Object();
	if(!window.DHTML_SUITE_THEME)
		var DHTML_SUITE_THEME='blue';
	if(!window.DHTML_SUITE_THEME_FOLDER)
		var DHTML_SUITE_THEME_FOLDER='../themes/';
		
	if(!window.DHTML_SUITE_JS_FOLDER)
		var DHTML_SUITE_JS_FOLDER='js/';
	
	var DHTMLSuite=new Object();
	var standardObjectsCreated=false;
	
	DHTMLSuite.eventEls=new Array();
	var widgetDep=new Object();
	widgetDep['formValidator']=['dhtmlSuite-formUtil.js'];
	widgetDep['paneSplitter']=['dhtmlSuite-paneSplitter.js','dhtmlSuite-paneSplitterModel.js','dhtmlSuite-dynamicContent.js','ajax.js'];
	widgetDep['menuBar']=['dhtmlSuite-menuBar.js','dhtmlSuite-menuItem.js','dhtmlSuite-menuModel.js'];
	widgetDep['windowWidget']=['dhtmlSuite-windowWidget.js','dhtmlSuite-resize.js','dhtmlSuite-dragDropSimple.js','ajax.js','dhtmlSuite-dynamicContent.js'];
	widgetDep['colorWidget']=['dhtmlSuite-colorWidgets.js','dhtmlSuite-colorUtil.js'];
	widgetDep['colorSlider']=['dhtmlSuite-colorWidgets.js','dhtmlSuite-colorUtil.js','dhtmlSuite-slider.js'];
	widgetDep['colorPalette']=['dhtmlSuite-colorWidgets.js','dhtmlSuite-colorUtil.js'];
	widgetDep['calendar']=['dhtmlSuite-calendar.js','dhtmlSuite-dragDropSimple.js'];
	widgetDep['dragDropTree']=['dhtmlSuite-dragDropTree.js'];
	widgetDep['slider']=['dhtmlSuite-slider.js'];
	widgetDep['dragDrop']=['dhtmlSuite-dragDrop.js'];
	widgetDep['imageEnlarger']=['dhtmlSuite-imageEnlarger.js','dhtmlSuite-dragDropSimple.js'];
	widgetDep['imageSelection']=['dhtmlSuite-imageSelection.js'];
	widgetDep['floatingGallery']=['dhtmlSuite-floatingGallery.js','dhtmlSuite-mediaModel.js'];
	widgetDep['contextMenu']=['dhtmlSuite-contextMenu.js','dhtmlSuite-menuBar.js','dhtmlSuite-menuItem.js','dhtmlSuite-menuModel.js'];
	widgetDep['dynamicContent']=['dhtmlSuite-dynamicContent.js','ajax.js'];
	widgetDep['textEdit']=['dhtmlSuite-textEdit.js','dhtmlSuite-textEditModel.js','dhtmlSuite-listModel.js'];
	widgetDep['listModel']=['dhtmlSuite-listModel.js'];
	widgetDep['resize']=['dhtmlSuite-resize.js'];
	widgetDep['dragDropSimple']=['dhtmlSuite-dragDropSimple.js'];
	widgetDep['dynamicTooltip']=['dhtmlSuite-dynamicTooltip.js','dhtmlSuite-dynamicContent.js','ajax.js'];
	widgetDep['modalMessage']=['dhtmlSuite-modalMessage.js','dhtmlSuite-dynamicContent.js','ajax.js'];
	widgetDep['tableWidget']=['dhtmlSuite-tableWidget.js','ajax.js'];
	widgetDep['progressBar']=['dhtmlSuite-progressBar.js'];
	widgetDep['tabView']=['dhtmlSuite-tabView.js','dhtmlSuite-dynamicContent.js','ajax.js'];
	widgetDep['infoPanel']=['dhtmlSuite-infoPanel.js','dhtmlSuite-dynamicContent.js','ajax.js'];
	widgetDep['form']=['dhtmlSuite-formUtil.js','dhtmlSuite-dynamicContent.js','ajax.js'];
	widgetDep['autoComplete']=['dhtmlSuite-autoComplete.js','ajax.js'];
	widgetDep['chainedSelect']=['dhtmlSuite-chainedSelect.js','ajax.js'];	
	
	var depCache=new Object();
	
	DHTMLSuite.include=function(widget)
	{
		if(!widgetDep[widget])
		{
			alert('Cannot find the files for widget '+widget+'. Please verify that the name is correct');
			return;
		}
		var files=widgetDep[widget];
		for(var no=0;no<files.length;no++)
		{
			if(!depCache[files[no]])
			{
				//alert(' src="'+DHTML_SUITE_JS_FOLDER+files[no]+'">')	
				document.write('<'+'script');document.write(' language="javascript"');
				document.write(' type="text/javascript"');
				document.write(' src="'+DHTML_SUITE_JS_FOLDER+files[no]+'">');
				document.write('</'+'script'+'>');
				depCache[files[no]]=true
			}
		}
	}
	
DHTMLSuite.discardElement=function(element){element=DHTMLSuite.commonObj.getEl(element);var gBin=document.getElementById('IELeakGBin');if(!gBin){gBin=document.createElement('DIV');gBin.id='IELeakGBin';gBin.style.display='none';document.body.appendChild(gBin)}
gBin.appendChild(element);gBin.innerHTML=''}
DHTMLSuite.createStandardObjects=function(){DHTMLSuite.clientInfoObj=new DHTMLSuite.clientInfo();DHTMLSuite.clientInfoObj.init();if(!DHTMLSuite.configObj){DHTMLSuite.configObj=new DHTMLSuite.config();DHTMLSuite.configObj.init()}
DHTMLSuite.commonObj=new DHTMLSuite.common();DHTMLSuite.variableStorage=new DHTMLSuite.globalVariableStorage();;DHTMLSuite.commonObj.init();DHTMLSuite.domQueryObj=new DHTMLSuite.domQuery();DHTMLSuite.commonObj.addEvent(window,'unload',function(){DHTMLSuite.commonObj.__clearMemoryGarbage()});standardObjectsCreated=true}
DHTMLSuite.config=function(){var imagePath;var cssPath;var defaultCssPath;var defaultImagePath}
DHTMLSuite.config.prototype={init:function(){this.imagePath=DHTML_SUITE_THEME_FOLDER+DHTML_SUITE_THEME+'/images/';this.cssPath=DHTML_SUITE_THEME_FOLDER+DHTML_SUITE_THEME+'/css/';this.defaultCssPath=this.cssPath;this.defaultImagePath=this.imagePath},setCssPath:function(newCssPath){this.cssPath=newCssPath},resetCssPath:function(){this.cssPath=this.defaultCssPath},resetImagePath:function(){this.imagePath=this.defaultImagePath},setImagePath:function(newImagePath){this.imagePath=newImagePath}}
DHTMLSuite.globalVariableStorage=function(){var menuBar_highlightedItems;this.menuBar_highlightedItems=new Array();var arrayDSObjects;var arrayOfDhtmlSuiteObjects;this.arrayDSObjects=new Array();this.arrayOfDhtmlSuiteObjects=this.arrayDSObjects;var ajaxObjects;this.ajaxObjects=new Array()}
DHTMLSuite.globalVariableStorage.prototype={}
DHTMLSuite.common=function(){var loadedCSSFiles;var cssCacheStatus;var eventEls;var isOkToSelect;this.okToSelect=true;this.cssCacheStatus=true;this.eventEls=new Array()}
DHTMLSuite.common.prototype={init:function(){this.loadedCSSFiles=new Array()},loadCSS:function(cssFile,prefixConfigPath){if(!prefixConfigPath&&prefixConfigPath!==false)prefixConfigPath=true;if(!this.loadedCSSFiles[cssFile]){this.loadedCSSFiles[cssFile]=true;var lt=document.createElement('LINK');if(!this.cssCacheStatus){if(cssFile.indexOf('?')>=0)cssFile=cssFile+'&';else cssFile=cssFile+'?';cssFile=cssFile+'rand='+Math.random()}
if(prefixConfigPath){lt.href=DHTMLSuite.configObj.cssPath+cssFile}else{lt.href=cssFile}
lt.rel='stylesheet';lt.media='screen';lt.type='text/css';document.getElementsByTagName('HEAD')[0].appendChild(lt)}},__setTextSelOk:function(okToSelect){this.okToSelect=okToSelect},__isTextSelOk:function(){return this.okToSelect},setCssCacheStatus:function(cssCacheStatus){this.cssCacheStatus=cssCacheStatus},getEl:function(elRef){if(typeof elRef=='string'){if(document.getElementById(elRef))return document.getElementById(elRef);if(document.forms[elRef])return document.forms[elRef];if(document[elRef])return document[elRef];if(window[elRef])return window[elRef]}
return elRef},isArray:function(el){if(el.constructor.toString().indexOf("Array")!=-1)return true;return false},getStyle:function(el,property){el=this.getEl(el);if(document.defaultView&&document.defaultView.getComputedStyle){var retVal=null;var comp=document.defaultView.getComputedStyle(el,'');if(comp){retVal=comp[property]}
return el.style[property]||retVal}
if(document.documentElement.currentStyle&&DHTMLSuite.clientInfoObj.isMSIE){var retVal=null;if(el.currentStyle)value=el.currentStyle[property];return(el.style[property]||retVal)}
return el.style[property]},getLeftPos:function(el){if(document.getBoxObjectFor){if(el.tagName!='INPUT'&&el.tagName!='SELECT'&&el.tagName!='TEXTAREA')return document.getBoxObjectFor(el).x
}
var returnValue=el.offsetLeft;while((el=el.offsetParent)!=null){if(el.tagName!='HTML'){returnValue+= el.offsetLeft;if(document.all)returnValue+=el.clientLeft}}
return returnValue},getTopPos:function(el){if(document.getBoxObjectFor){if(el.tagName!='INPUT'&&el.tagName!='SELECT'&&el.tagName!='TEXTAREA')return document.getBoxObjectFor(el).y
}
var returnValue=el.offsetTop;while((el=el.offsetParent)!=null){if(el.tagName!='HTML'){returnValue+=(el.offsetTop-el.scrollTop);if(document.all)returnValue+=el.clientTop}}
return returnValue},getCookie:function(name){var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length)))return null;if(start==-1)return null;var end=document.cookie.indexOf(";",len);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(len,end))},setCookie:function(name,value,expires,path,domain,secure){expires=expires*60*60*24*1000;var today=new Date();var expires_date=new Date(today.getTime()+(expires));var cookieString=name+"="+escape(value)+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+
((secure)?";secure":"");document.cookie=cookieString},deleteCookie:function(name,path,domain){if(this.getCookie(name))document.cookie=name+"="+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+
";expires=Thu,01-Jan-1970 00:00:01 GMT"},cancelEvent:function(){return false},addEvent:function(obj,type,fn,suffix){if(!suffix)suffix='';if(obj.attachEvent){if(typeof DHTMLSuite_funcs[type+fn+suffix]!='function'){DHTMLSuite_funcs[type+fn+suffix]=function(){fn.apply(window.event.srcElement)};obj.attachEvent('on'+type,DHTMLSuite_funcs[type+fn+suffix])}
obj=null} else {obj.addEventListener(type,fn,false)}
this.__addEventEl(obj)},removeEvent:function(obj,type,fn,suffix){if(obj.detachEvent){obj.detachEvent('on'+type,DHTMLSuite_funcs[type+fn+suffix]);DHTMLSuite_funcs[type+fn+suffix]=null;obj=null} else {obj.removeEventListener(type,fn,false)}},__clearMemoryGarbage:function(){if(!DHTMLSuite.clientInfoObj.isMSIE)return;for(var no=0;no<DHTMLSuite.eventEls.length;no++){try{var el=DHTMLSuite.eventEls[no];el.onclick=null;el.onmousedown=null;el.onmousemove=null;el.onmouseout=null;el.onmouseover=null;el.onmouseup=null;el.onfocus=null;el.onblur=null;el.onkeydown=null;el.onkeypress=null;el.onkeyup=null;el.onselectstart=null;el.ondragstart=null;el.oncontextmenu=null;el.onscroll=null;el=null}catch(e){}}
for(var no in DHTMLSuite.variableStorage.arrayDSObjects){DHTMLSuite.variableStorage.arrayDSObjects[no]=null}
window.onbeforeunload=null;window.onunload=null;DHTMLSuite=null},__addEventEl:function(el){DHTMLSuite.eventEls[DHTMLSuite.eventEls.length]=el},getSrcElement:function(e){var el;if(e.target)el=e.target;else if(e.srcElement)el=e.srcElement;if(el.nodeType==3)
el=el.parentNode;return el},getKeyFromEvent:function(e){var code=this.getKeyCode(e);return String.fromCharCode(code)},getKeyCode:function(e){if(e.keyCode)code=e.keyCode;else if(e.which)code=e.which;return code},isObjectClicked:function(obj,e){var src=this.getSrcElement(e);var string=src.tagName+'('+src.className+')';if(src==obj)return true;while(src.parentNode&&src.tagName.toLowerCase()!='html'){src=src.parentNode;string=string+','+src.tagName+'('+src.className+')';if(src==obj)return true}
return false},getObjectByClassName:function(e,className){var src=this.getSrcElement(e);if(src.className==className)return src;while(src&&src.tagName.toLowerCase()!='html'){src=src.parentNode;if(src.className==className)return src}
return false},getObjectByAttribute:function(e,attribute){var src=this.getSrcElement(e);var att=src.getAttribute(attribute);if(!att)att=src[attribute];if(att)return src;while(src&&src.tagName.toLowerCase()!='html'){src=src.parentNode;var att=src.getAttribute('attribute');if(!att)att=src[attribute];if(att)return src}
return false},getUniqueId:function(){var no=Math.random()+'';no=no.replace('.','');var no2=Math.random()+'';no2=no2.replace('.','');return no+no2},getAssociativeArrayFromString:function(propertyString){if(!propertyString)return;var retArray=new Array();var items=propertyString.split(/,/g);for(var no=0;no<items.length;no++){var tokens=items[no].split(/:/);retArray[tokens[0]]=tokens[1]}
return retArray},correctPng:function(el){el=DHTMLSuite.commonObj.getEl(el);var img=el;var width=img.width;var height=img.height;var html='<span style="display:inline-block;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+img.src+'\',sizingMethod=\'scale\');width:'+width+';height:'+height+'"></span>';img.outerHTML=html},__evaluateJs:function(obj){obj=this.getEl(obj);var scriptTags=obj.getElementsByTagName('SCRIPT');var string='';var jsCode='';for(var no=0;no<scriptTags.length;no++){if(scriptTags[no].src){var head=document.getElementsByTagName("head")[0];var scriptObj=document.createElement("script");scriptObj.setAttribute("type","text/javascript");scriptObj.setAttribute("src",scriptTags[no].src)}else{if(DHTMLSuite.clientInfoObj.isOpera){jsCode=jsCode+scriptTags[no].text+'\n'}
else
jsCode=jsCode+scriptTags[no].innerHTML}}
if(jsCode)this.__installScript(jsCode)},__installScript:function(script){try{if(!script)
return;if(window.execScript){window.execScript(script)
}else if(window.jQuery&&jQuery.browser.safari){window.setTimeout(script,0)}else{window.setTimeout(script,0)}}catch(e){}},__evaluateCss:function(obj){obj=this.getEl(obj);var cssTags=obj.getElementsByTagName('STYLE');var head=document.getElementsByTagName('HEAD')[0];for(var no=0;no<cssTags.length;no++){head.appendChild(cssTags[no])}}}
DHTMLSuite.clientInfo=function(){var browser;var isOpera;var isMSIE;var isOldMSIE;var isFirefox;var navigatorVersion;var isOldMSIE}
DHTMLSuite.clientInfo.prototype={init:function(){this.browser=navigator.userAgent;this.isOpera=(this.browser.toLowerCase().indexOf('opera')>=0)?true:false;this.isFirefox=(this.browser.toLowerCase().indexOf('firefox')>=0)?true:false;this.isMSIE=(this.browser.toLowerCase().indexOf('msie')>=0)?true:false;this.isOldMSIE=(this.browser.toLowerCase().match(/msie\s[0-6]/gi))?true:false;this.isSafari=(this.browser.toLowerCase().indexOf('safari')>=0)?true:false;this.navigatorVersion=navigator.appVersion.replace(/.*?MSIE\s(\d\.\d).*/g,'$1')/1;this.isOldMSIE=(this.isMSIE&&this.navigatorVersion<7)?true:false},getBrowserWidth:function(){if(self.innerWidth)return self.innerWidth;return document.documentElement.offsetWidth},getBrowserHeight:function(){if(self.innerHeight)return self.innerHeight;return document.documentElement.offsetHeight}}
DHTMLSuite.domQuery=function(){document.getElementsByClassName=this.getElementsByClassName;document.getElementsByAttribute=this.getElementsByAttribute}
DHTMLSuite.domQuery.prototype={}
/*------------ dhtmlSuite-common.js -------------*/


/*------------ dhtmlSuite-autoComplete.js ----------*/
	if(!window.DHTMLSuite)var DHTMLSuite=new Object();
	DHTMLSuite.autoComplete=function()
	{
		var layoutCss;
		var country;
		var ajaxBox_offsetX;
		var ajaxBox_offsetY;
		var minimumLettersBeforeLookup;
		var ajax_list_currentLetters;
		var ajax_list_cachedLists
		var ajax_optionDiv;
		var ajax_list_MSIE;
		var ajax_list_activeItem;
		var ajax_list_objects;
		var ajax_list_activeInput;
		var ajax_list_activeItem;
		var ajax_list_optionDivFirstItem
		var ajax_optionDiv;
		var ajax_optionDiv_iframe;
		this.layoutCss='auto-complete.css';
		this.ajaxBox_offsetX=0;
		this.ajaxBox_offsetY=0;
		this.ajax_list_currentLetters=new Array();
		this.ajax_list_cachedLists=new Array();
		this.ajax_optionDiv=false;
		this.ajax_list_MSIE=false;
		if(navigator.userAgent.indexOf('MSIE')>=0&&navigator.userAgent.indexOf('Opera')<0)
		this.ajax_list_MSIE=true;
		this.ajax_list_activeItem;
		this.ajax_list_objects=new Array();
		this.ajax_list_activeInput=false;
		this.ajax_list_activeItem;
		this.ajax_list_optionDivFirstItem=false;
		this.ajax_optionDiv=false;
		this.ajax_optionDiv_iframe=false;
		
		var ajax_list_MSIE=false;
		
		/*
		*	BELOW MENTIONED VARIABLES ARE USED FOR AUTOCOMPLETE BOXES
		*	WHICH WE ARE USING IN IFRAME
		*	CHANGED BY SAGAR FOR UPLOAD JOB ON 01-06-2009
		*/
		this.resizeiframe = false;
		this.iframeid = "";
		this.extraframeheight = 0;
		
		if(navigator.userAgent.indexOf('MSIE')>=0&&navigator.userAgent.indexOf('Opera')<0)ajax_list_MSIE=true;
			this.minimumLettersBeforeLookup=1;
		try
		{
			if(!standardObjectsCreated)DHTMLSuite.createStandardObjects()
		}
		catch(e)
		{
			
			//alert('Include the dhtmlSuite-common.js file')
		}
		
		this.objectIndex=DHTMLSuite.variableStorage.arrayDSObjects.length;
		DHTMLSuite.variableStorage.arrayDSObjects[this.objectIndex]=this;
		document.body.setAttribute("objectIndex",this.objectIndex);
		DHTMLSuite.commonObj.loadCSS(this.layoutCss)
	}
	
	
	DHTMLSuite.autoComplete.prototype={
		
		    add:function(inputObjId,externalFile){
			var refObject=DHTMLSuite.variableStorage.arrayDSObjects[this.objectIndex];
			
			//eval("document.getElementById('"+inputObjId+"').onkeyup=function(e){refObject.__showOptions(e,'"+inputObjId+"','"+externalFile+"')};"); 
			
			eval("document.getElementById('"+inputObjId+"').onkeyup=function(e){refObject.__showOptions(e,'"+inputObjId+"','"+externalFile+"')};");
			
			DHTMLSuite.commonObj.__addEventEl(document.getElementById(inputObjId));
			
			},
			
			setLayoutCss:function(newCssFileName){this.layoutCss=newCssFileName},
			
			__showOptions:function(e,inputObjId,externalFile) //,extraParams
			{
				
				
			var inputObj=document.getElementById(inputObjId);
			var ind=this.objectIndex;
			//alert(inputObj.value);
			if(document.all)e=event;
			
			if(e.keyCode==13||e.keyCode==9)return;
			if(this.ajax_list_currentLetters[inputObj.name]==inputObj.value)return;
			if(!this.ajax_list_cachedLists[inputObj.id])this.ajax_list_cachedLists[inputObj.id]=new Array();
			this.ajax_list_currentLetters[inputObj.name]=inputObj.value;
			if(!this.ajax_optionDiv){this.ajax_optionDiv=document.createElement('DIV');
			this.ajax_optionDiv.id='ajax_listOfOptions';
			document.body.appendChild(this.ajax_optionDiv);			
			if(this.ajax_list_MSIE){this.ajax_optionDiv_iframe=document.createElement('IFRAME');
			this.ajax_optionDiv_iframe.border='0';
			this.ajax_optionDiv_iframe.style.width=this.ajax_optionDiv.clientWidth+'px';
			this.ajax_optionDiv_iframe.style.height=this.ajax_optionDiv.clientHeight+'px';
			this.ajax_optionDiv_iframe.id='ajax_listOfOptions_iframe';
			document.body.appendChild(this.ajax_optionDiv_iframe)}
			var allInputs=document.getElementsByTagName('INPUT');
			
			for(var no=0;no<allInputs.length;no++)
			{
				if(!allInputs[no].onkeyup)allInputs[no].onfocus=this.__ajaxOptionsHide}
				var allSelects=document.getElementsByTagName('SELECT');

				
				for(var no=0;no<allSelects.length;no++)
				{
					allSelects[no].onfocus=this.__ajaxOptionsHide
					
				}
				var oldonkeydown=document.body.onkeydown;
				if(typeof oldonkeydown!='function')
				{
					document.body.onkeydown=this.__ajaxOptionKeyNavigation
				}
				else
				{
					document.body.onkeydown=function()
					{
						oldonkeydown();
						this.__ajaxOptionKeyNavigation()
					}
				}
				var oldonresize=document.body.onresize;
				if(typeof oldonresize!='function')
				{
					document.body.onresize=function()
					{
						this.__ajaxOptionResize(inputObj)
					}
				}
				else
				{
					document.body.onresize=function(){oldonresize();
					this.__ajaxOptionResize(inputObj)}}}
					if(inputObj.value.length < this.minimumLettersBeforeLookup)
					{
						this.__ajaxOptionsHide();
						return
					}
					this.ajax_optionDiv.style.top=(this.__ajaxGetTopPos(inputObj)+inputObj.offsetHeight+this.ajaxBox_offsetY)+'px';
					this.ajax_optionDiv.style.left=(this.__ajaxGetLeftPos(inputObj)+this.ajaxBox_offsetX)+'px';
					if(this.ajax_optionDiv_iframe)
					{
						this.ajax_optionDiv_iframe.style.left=this.ajax_optionDiv.style.left;
						this.ajax_optionDiv_iframe.style.top=this.ajax_optionDiv.style.top
					}
					this.ajax_list_activeInput=inputObj;
					this.ajax_optionDiv.onselectstart= this.__ajaxListCancelEvent;
					/*if(this.ajax_list_cachedLists[inputObj.id][inputObj.value.toLowerCase()])
					{
						alert("dada");
						this.__ajaxOptionListBuildList(inputObj.value,inputObj.id)
					}
					else
					{*/
						this.ajax_optionDiv.innerHTML='';
						var ajaxIndex=this.ajax_list_objects.length;
						this.ajax_list_objects[ajaxIndex]=new sack();
						//CHANGE BY ONKAR TO PASS EXTRA PARAM FOR JOB SEARCH
						try{
							//var url=externalFile+'?letters='+inputObj.value.replace(" ","+")+'&c='+country;
							var countryid = "country_"+inputObjId;
							var url=externalFile+'?letters='+inputObj.value.replace(" ","+")+'&c='+document.getElementById(countryid).value;
						   }
						catch(e)
						{
							//var url=externalFile+'&letters='+inputObj.value.replace(" ","+");
							var url=externalFile+'?letters='+inputObj.value.replace(" ","+");
						}
						
						//CHANGE BY SAGAR TO PASS EXTRA STATE PARAM FOR UPLOAD JOB
						var strState = "";
						try{
								var stateid = "state_"+inputObjId;
								var strState = "&s="+document.getElementById(stateid).value;
						   }
						catch(e)
						{}
						
						if (strState != "")
						{
							url = url + strState;
						}
						
						this.ajax_list_objects[ajaxIndex].requestFile=url;
						this.ajax_list_objects[ajaxIndex].onCompletion=function()
						{
							DHTMLSuite.variableStorage.arrayDSObjects[ind].__ajaxOptionListShowContent(ajaxIndex,inputObj)
						};					
						this.ajax_list_objects[ajaxIndex].runAJAX()
					/*}*/
				},
			
			__ajaxOptionsHide:function()
			{
				if(this.ajax_optionDiv)this.ajax_optionDiv.style.display='none';
				if(this.ajax_optionDiv_iframe)this.ajax_optionDiv_iframe.style.display='none'
			},
			
			__ajaxOptionKeyNavigation:function(e)
			{
				if(document.all)e=event;
				var objectIndex=document.body.getAttribute("objectIndex");
				var refObject=DHTMLSuite.variableStorage.arrayDSObjects[objectIndex];
				if(!refObject.ajax_optionDiv)return;
				if(refObject.ajax_optionDiv.style.display=='none')return;
				if(e.keyCode==38)
				{
					if(!refObject.ajax_list_activeItem)return;
					if(refObject.ajax_list_activeItem&&!refObject.ajax_list_activeItem.previousSibling)return;
					refObject.__ajaxOptionsRollOverActiveItem(refObject.ajax_list_activeItem.previousSibling,true)
				}
				
				if(e.keyCode==40)
				{
					if(!refObject.ajax_list_activeItem)
					{
						refObject.__ajaxOptionsRollOverActiveItem(ajax_list_optionDivFirstItem,true)
					}else
					{
						if(!refObject.ajax_list_activeItem.nextSibling)return;
						refObject.__ajaxOptionsRollOverActiveItem(refObject.ajax_list_activeItem.nextSibling,true)
					}
				}
				if(e.keyCode==13||e.keyCode==9)
				{
					if(refObject.ajax_list_activeItem&&refObject.ajax_list_activeItem.className=='optionDivSelected')refObject.__ajaxOptionSetValue(false,refObject.ajax_list_activeItem);
					if(e.keyCode==13)return false;
					else return true
				}
				if(e.keyCode==27)
				{
					refObject.__ajaxOptionsHide()
				}
			}
				
			,__ajaxOptionsRollOverActiveItem:function(item,fromKeyBoard)
			{
				//this.ajax_optionDiv.focus();
				if(this.ajax_list_activeItem)this.ajax_list_activeItem.className='optionDiv';
				item.className='optionDivSelected';
				this.ajax_list_activeItem=item;
				if(fromKeyBoard)
				{
					if(this.ajax_list_activeItem.offsetTop > this.ajax_optionDiv.offsetHeight)
					{
						this.ajax_optionDiv.scrollTop=this.ajax_list_activeItem.offsetTop-this.ajax_optionDiv.offsetHeight+this.ajax_list_activeItem.offsetHeight+2 
					}
					if(this.ajax_list_activeItem.offsetTop < this.ajax_optionDiv.scrollTop)
					{
							this.ajax_optionDiv.scrollTop=0;
					}
				}
			}
			
			,__ajaxOptionResize:function(inputObj)
			{
				this.ajax_optionDiv.style.top =(this.__ajaxGetTopPos(inputObj)+inputObj.offsetHeight+this.ajaxBox_offsetY)+'px';
				this.ajax_optionDiv.style.left=(this.__ajaxGetLeftPos(inputObj)+this.ajaxBox_offsetX)+'px';
				if(this.ajax_optionDiv_iframe)
				{
					this.ajax_optionDiv_iframe.style.left=this.ajax_optionDiv.style.left;
					this.ajax_optionDiv_iframe.style.top=this.ajax_optionDiv.style.top
				}
			}
	
			,__ajaxGetTopPos:function(inputObj)
			{
				var returnValue=inputObj.offsetTop;
				while((inputObj=inputObj.offsetParent)!=null)
				{
					returnValue+= inputObj.offsetTop
				}
				return returnValue
			}
			
			,__ajaxGetLeftPos:function(inputObj)
			{
				var returnValue=inputObj.offsetLeft;
				while((inputObj=inputObj.offsetParent)!=null)returnValue+= inputObj.offsetLeft;
				return returnValue
			}
			
			,__ajaxOptionListShowContent:function(ajaxIndex,inputObj)
			{
				// CHANGED BY SAGAR FOR UPLOAD JOB CITY AUTOCOMPLETE
				if (this.resizeiframe && this.iframeid != "")
				{
					this.__fnResizeIframe();
				}
				
				var letters=inputObj.value;
				var content=this.ajax_list_objects[ajaxIndex].response;
				var elements=content.split('|');
				this.ajax_list_cachedLists[inputObj.id][letters.toLowerCase()]=elements;
				this.__ajaxOptionListBuildList(letters,inputObj.id)
			}
			
			,__fnResizeIframe:function()
			{
				try{
					intHeight = parent.document.getElementById(this.iframeid).contentWindow.document.body.scrollHeight;
					intHeight = intHeight + this.extraframeheight;
					parent.document.getElementById(this.iframeid).style.height = intHeight + "px";
				}
				catch(e)
				{}
			}
			
			,__fnOriginalIframe:function()
			{
				try{
					intHeight = parent.document.getElementById(this.iframeid).contentWindow.document.body.scrollHeight;
					parent.document.getElementById(this.iframeid).style.height = intHeight + "px";
				}
				catch(e)
				{}
			}
			
			,__ajaxOptionListBuildList:function(letters,inputObjId)
			{
				var ind=this.objectIndex;
				this.ajax_optionDiv.innerHTML='';
				this.ajax_list_activeItem=false;
				if(this.ajax_list_cachedLists[inputObjId][letters.toLowerCase()].length<=1)
				{
					this.__ajaxOptionsHide();
					return
				}
				this.ajax_list_optionDivFirstItem=false;
				var optionsAdded=false;
				
				for(var no=0;no<this.ajax_list_cachedLists[inputObjId][letters.toLowerCase()].length;no++)
				{
					
					if(this.ajax_list_cachedLists[inputObjId][letters.toLowerCase()][no].length==0)continue;
					optionsAdded=true;
					var div=document.createElement('DIV');
					var items=this.ajax_list_cachedLists[inputObjId][letters.toLowerCase()][no].split(/###/gi);
					if(this.ajax_list_cachedLists[inputObjId][letters.toLowerCase()].length==1&&this.ajax_list_activeInput.value==items[0])
					{
						this.__ajaxOptionsHide();
						return
					}
					div.innerHTML=items[items.length-1];
					div.id=items[0];
					div.className='optionDiv';
					div.setAttribute('objectIndex',ind);
					div.onmouseover=function()
					{
						DHTMLSuite.variableStorage.arrayDSObjects[ind].__ajaxOptionsRollOverActiveItem(this,false)
					}
					div.onclick = this.__ajaxOptionSetValue;
					
					if(!this.ajax_list_optionDivFirstItem)this.ajax_list_optionDivFirstItem=div;
					this.ajax_optionDiv.appendChild(div)
				}
			
				if(optionsAdded)
				{
					this.ajax_optionDiv.style.display='block';
					if(this.ajax_optionDiv_iframe)this.ajax_optionDiv_iframe.style.display='';
					this.__ajaxOptionsRollOverActiveItem(this.ajax_list_optionDivFirstItem,true)
				}	
			}
			
			,__ajaxOptionSetValue:function(e,divOptionObj)
			{
				if(!divOptionObj)divOptionObj=this;

				if (autoCom.resizeiframe && autoCom.iframeid != "")
					autoCom.__fnOriginalIframe();
				
				var referenceToObject = DHTMLSuite.variableStorage.arrayDSObjects[divOptionObj.getAttribute('objectIndex')];
				var tmpValue = divOptionObj.innerHTML;

				if(referenceToObject.ajax_list_MSIE)
					tmpValue=divOptionObj.innerText;
				else 
					tmpValue=divOptionObj.textContent;

				if(!tmpValue)
					tmpValue=divOptionObj.innerHTML;

				referenceToObject.ajax_list_activeInput.value = tmpValue;
				
				var arrCity = tmpValue.split("-");
				tmpValue = arrCity[0];
				
				/*if(document.getElementById(referenceToObject.ajax_list_activeInput.name+'_hidden'))
				{
					document.getElementById(referenceToObject.ajax_list_activeInput.name+'_hidden').value=divOptionObj.id;
				}*/
				
				if(document.getElementById(eval(referenceToObject.ajax_list_activeInput.name)))
				{
					//if(eval(referenceToObject.ajax_list_activeInput.name)=='companyid'||eval(referenceToObject.ajax_list_activeInput.name)=='individualid')
					try 
					{
						if(checktype=='type')
						{
							document.getElementById(eval(referenceToObject.ajax_list_activeInput.name)).value=divOptionObj.id;
						}
						else
						{
							document.getElementById(eval(referenceToObject.ajax_list_activeInput.name)).value=tmpValue+'|'+divOptionObj.id;	
						}
					}
					catch(e)
					{
						document.getElementById(eval(referenceToObject.ajax_list_activeInput.name)).value=tmpValue+'|'+divOptionObj.id;
					}
					
					//else
					//{}
				}
				
				
				/*if(document.getElementById(this.hiddenfields[referenceToObject.ajax_list_activeInput.name]))
				{
					var type = this.hiddenfields['type'];
					var Individualtype = this.hiddenfields['individualtype'];
					if(type=='companyid'||Individualtype=='individualid')
					{
						document.getElementById(this.hiddenfields[referenceToObject.ajax_list_activeInput.name]).value=divOptionObj.id;
					}
					else
					{
						document.getElementById(this.hiddenfields[referenceToObject.ajax_list_activeInput.name]).value=tmpValue+'|'+divOptionObj.id;
					}
				}*/
				

				//document.getElementById(referenceToObject.ajax_list_activeInput.name+'_hidden').value=divOptionObj.id;
				referenceToObject.__ajaxOptionsHide()
			}
			
			,__ajaxListCancelEvent:function(){return false}
		}
/*------------ dhtmlSuite-autoComplete.js ----------*/

/*------------ ajax-dynamic-content.js -------------*/
/************************************************************************************************************
Ajax dynamic content
Copyright (C) 2006  DTHMLGoodies.com, Alf Magne Kalleland

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

Dhtmlgoodies.com., hereby disclaims all copyright interest in this script
written by Alf Magne Kalleland.

Alf Magne Kalleland, 2006
Owner of DHTMLgoodies.com
	
************************************************************************************************************/	



var enableCache = true;
var jsCache = new Array();

var isCloseBtnEnable = false;

var dynamicContent_ajaxObjects = new Array();

function ajax_showContent(divId,ajaxIndex,url)
{
	document.getElementById(divId).innerHTML = dynamicContent_ajaxObjects[ajaxIndex].response;
	if(enableCache){
		jsCache[url] = 	dynamicContent_ajaxObjects[ajaxIndex].response;
	}
	dynamicContent_ajaxObjects[ajaxIndex] = false;
}

function ajax_loadContent(divId,url)
{	
	contentHtml = document.getElementById(url).innerHTML;
	contentHtml = "<div style='float:right;'><img align='absmiddle' src='images/btn_close.gif' onclick='ajax_hideTooltip()' style='cursor:pointer;'></div>" + contentHtml;
	
	if(isCloseBtnEnable == true)
	{
		contentHtml = contentHtml + "<center><span style='float:left;'>Unless you click</span><div class='closebutton' onclick='ajax_hideTooltip()'>Close</div></center>";
	}
	document.getElementById(divId).innerHTML = contentHtml;
	return true;

	/*if(enableCache && jsCache[url]){
		document.getElementById(divId).innerHTML = jsCache[url];
		}*/

	
	var ajaxIndex = dynamicContent_ajaxObjects.length;


	document.getElementById(divId).innerHTML = 'Loading content - please wait';
	dynamicContent_ajaxObjects[ajaxIndex] = new sack();
	
	if(url.indexOf('?')>=0){
		dynamicContent_ajaxObjects[ajaxIndex].method='GET';
		var string = url.substring(url.indexOf('?'));
		url = url.replace(string,'');
		string = string.replace('?','');
		var items = string.split(/&/g);
		for(var no=0;no<items.length;no++){
			var tokens = items[no].split('=');
			if(tokens.length==2){
				dynamicContent_ajaxObjects[ajaxIndex].setVar(tokens[0],tokens[1]);
			}	
		}	
		url = url.replace(string,'');
	}
	
	dynamicContent_ajaxObjects[ajaxIndex].requestFile = url;	// Specifying which file to get
	dynamicContent_ajaxObjects[ajaxIndex].onCompletion = function(){ ajax_showContent(divId,ajaxIndex,url); };	// Specify function that will be executed after file has been found
	dynamicContent_ajaxObjects[ajaxIndex].runAJAX();		// Execute AJAX function	
	
	
}
/*------------ ajax-dynamic-content.js -------------*/

/*------------ ajax-tooltip.js -------------*/
/************************************************************************************************************
Ajax tooltip
Copyright (C) 2006  DTHMLGoodies.com, Alf Magne Kalleland

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

Dhtmlgoodies.com., hereby disclaims all copyright interest in this script
written by Alf Magne Kalleland.

Alf Magne Kalleland, 2006
Owner of DHTMLgoodies.com
	
************************************************************************************************************/	




/* Custom variables */

/* Offset position of tooltip */
var x_offset_tooltip = 5;
var y_offset_tooltip = 0;
var boolAutoHide = false;
var intIncreadLpos = 0;
var intDecreasepos = 0;
var intObjectPosition = 0;
/* Don't change anything below here */


var ajax_tooltipObj = false;
var ajax_tooltipObj_iframe = false;

var ajax_tooltip_MSIE = false;
if(navigator.userAgent.indexOf('MSIE')>=0)ajax_tooltip_MSIE=true;


function ajax_showTooltip(externalFile,inputObj,width,height)
{ 	
	
	intObjectPosition = ajaxTooltip_getLeftPos(inputObj);
	
	if (intIncreadLpos > 0)
		intObjectPosition = intObjectPosition + intIncreadLpos;
		
	if (intDecreasepos > 0)
		intObjectPosition = intObjectPosition - intDecreasepos;
		
	intIncreadLpos = 0;
	intDecreasepos = 0;
		
	if (intObjectPosition < 500)
	{
		strLeftClassName = "ajax_tooltip_arrow";
		strClassName = "ajax_tooltip_content";
	}
	else
	{
		strLeftClassName = "ajax_tooltip_arrow_right";
		strClassName = "ajax_tooltip_content_right";
	}
	
	if (width)
		width = width+"px";
	if (height)
		height = height+"px";
		
	if(!ajax_tooltipObj)	/* Tooltip div not created yet ? */
	{
		ajax_tooltipObj = document.createElement('DIV');
		ajax_tooltipObj.style.position = 'absolute';
		
		ajax_tooltipObj.id = "ajax_tooltipObj";		
		document.body.appendChild(ajax_tooltipObj);

		var leftDiv = document.createElement('DIV');	/* Create arrow div */
			
		leftDiv.className = strLeftClassName;
		leftDiv.id = 'ajax_tooltip_arrow';
		
		ajax_tooltipObj.appendChild(leftDiv);
		
		var contentDiv = document.createElement('DIV'); /* Create tooltip content div */
		contentDiv.className = strClassName;
		ajax_tooltipObj.appendChild(contentDiv);
		contentDiv.id = 'ajax_tooltip_content';
		contentDiv.style.height = height;
		contentDiv.style.width = width;
		
		/* Create iframe object for MSIE in order to make the tooltip cover select boxes */
		if(ajax_tooltip_MSIE){
			
			ajax_tooltipObj_iframe = document.createElement('<IFRAME frameborder="0">');
			ajax_tooltipObj_iframe.style.position = 'absolute';
			ajax_tooltipObj_iframe.border='0';
			ajax_tooltipObj_iframe.frameborder=0;
			ajax_tooltipObj_iframe.style.backgroundColor='#FFF';
			ajax_tooltipObj_iframe.src = 'about:blank';
			contentDiv.appendChild(ajax_tooltipObj_iframe);
			ajax_tooltipObj_iframe.style.left = '0px';
			ajax_tooltipObj_iframe.style.top = '0px';
		}

			
	}
	else
	{
		document.getElementById('ajax_tooltip_arrow').className = strLeftClassName;
		document.getElementById('ajax_tooltip_content').className = strClassName;
		document.getElementById('ajax_tooltip_content').style.height = height;
		document.getElementById('ajax_tooltip_content').style.width = width;
	}
	// Find position of tooltip
	ajax_tooltipObj.style.display='block';

	ajax_loadContent('ajax_tooltip_content',externalFile);
	if(ajax_tooltip_MSIE){
		ajax_tooltipObj_iframe.style.width = ajax_tooltipObj.clientWidth + 'px';
		ajax_tooltipObj_iframe.style.height = ajax_tooltipObj.clientHeight + 'px';
	}

	ajax_positionTooltip(inputObj);
}

function ajax_positionTooltip(inputObj)
{
	if (ajaxTooltip_getLeftPos(inputObj) < 500)
	{
		var leftPos = (ajaxTooltip_getLeftPos(inputObj) + inputObj.offsetWidth);
		var topPos = ajaxTooltip_getTopPos(inputObj);
	}
	else
	{
		var leftPos = ajaxTooltip_getLeftPos(inputObj);
		var topPos = (ajaxTooltip_getTopPos(inputObj) - 25);
	}
	
	/*
	var rightedge=ajax_tooltip_MSIE? document.body.clientWidth-leftPos : window.innerWidth-leftPos
	var bottomedge=ajax_tooltip_MSIE? document.body.clientHeight-topPos : window.innerHeight-topPos
	*/
	var tooltipWidth = document.getElementById('ajax_tooltip_content').offsetWidth +  document.getElementById('ajax_tooltip_arrow').offsetWidth; 
	// Dropping this reposition for now because of flickering
	//var offset = tooltipWidth - rightedge; 
	//if(offset>0)leftPos = Math.max(0,leftPos - offset - 5);
	
	ajax_tooltipObj.style.left = leftPos + 'px';
	ajax_tooltipObj.style.top = topPos + 'px';	
	
	
}


function ajax_hideTooltip()
{
	/*try()
	{ 
		document.getElementById('id_ForceDelete').value = "0";
	}
	catch(e){}
*/	
	ajax_tooltipObj.style.display='none';
	boolAutoHide = false;
	fnShowFormElements();
}

function ajaxTooltip_getTopPos(inputObj)
{			
  var returnValue = inputObj.offsetTop;
   while((inputObj = inputObj.offsetParent) != null){
  	if(inputObj.tagName!='HTML')returnValue += inputObj.offsetTop;
  }
  return returnValue;
}

function ajaxTooltip_getLeftPos(inputObj)
{
  var returnValue = inputObj.offsetLeft;
  while((inputObj = inputObj.offsetParent) != null){
  	if(inputObj.tagName!='HTML')returnValue += inputObj.offsetLeft;
  }
  return returnValue;
}
/*------------ ajax-tooltip.js -------------*/

/*------------ encryption.js -------------*/
/**
*
*  Base64 encode / decode
*  http://www.webtoolkit.info/
*
**/

var Base64 = {

	// private property
	_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",

	// public method for encoding
	encode : function (input) {
		var output = "";
		var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
		var i = 0;

		input = Base64._utf8_encode(input);

		while (i < input.length) {

			chr1 = input.charCodeAt(i++);
			chr2 = input.charCodeAt(i++);
			chr3 = input.charCodeAt(i++);

			enc1 = chr1 >> 2;
			enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
			enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
			enc4 = chr3 & 63;

			if (isNaN(chr2)) {
				enc3 = enc4 = 64;
			} else if (isNaN(chr3)) {
				enc4 = 64;
			}

			output = output +
			this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
			this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);

		}

		return output;
	},

	// public method for decoding
	decode : function (input) {
		var output = "";
		var chr1, chr2, chr3;
		var enc1, enc2, enc3, enc4;
		var i = 0;

		input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

		while (i < input.length) {

			enc1 = this._keyStr.indexOf(input.charAt(i++));
			enc2 = this._keyStr.indexOf(input.charAt(i++));
			enc3 = this._keyStr.indexOf(input.charAt(i++));
			enc4 = this._keyStr.indexOf(input.charAt(i++));

			chr1 = (enc1 << 2) | (enc2 >> 4);
			chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
			chr3 = ((enc3 & 3) << 6) | enc4;

			output = output + String.fromCharCode(chr1);

			if (enc3 != 64) {
				output = output + String.fromCharCode(chr2);
			}
			if (enc4 != 64) {
				output = output + String.fromCharCode(chr3);
			}

		}

		output = Base64._utf8_decode(output);

		return output;

	},

	// private method for UTF-8 encoding
	_utf8_encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";

		for (var n = 0; n < string.length; n++) {

			var c = string.charCodeAt(n);

			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}

		}

		return utftext;
	},

	// private method for UTF-8 decoding
	_utf8_decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;

		while ( i < utftext.length ) {

			c = utftext.charCodeAt(i);

			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}

		}

		return string;
	}

}
/*------------ encryption.js -------------*/

/*------------ login.js -------------*/
	
	var boolFirstName = 0;
	var boolLastName = 0;
	var boolEmail = 0;
	var boolPassword = 0;
	var strLoaderDiv = "";
	//var BckEndCommentAction = "shweta";
	
	
	
	function fnLoginField(objField)
	{
		strFieldValue = objField.value;
		switch(objField.accessKey)
		{
			case "LE?":
				objField.value = "";
				objField.accessKey = "LE";
				strLoginEmail = "Email";
				document.getElementById('lbl_txtloginemail').innerHTML = strLoginEmail;
				document.getElementById('lbl_txtloginemail').style.display = "";
				document.getElementById('lbl_txtloginemail').style.color=  "#000000";
				document.getElementById('id_txtloginemail').style.color=  "#000000";
			break;
			case "LP?":
				objField.value = "";
				objField.className = "input";
				objField.accessKey = "LP";
				strLoginPassword = "Password";
				document.getElementById('lbl_txtloginpassword').innerHTML = strLoginPassword;
				document.getElementById('lbl_txtloginpassword').style.display = "";
				document.getElementById('lbl_txtloginpassword').style.color=  "#000000";
				document.getElementById('id_txtloginpassword').style.color=  "#000000";
			break;
			case "SF?":
				boolFirstName = 1;
				objField.value = "";
				objField.accessKey = "SF";
				strSignupFirstName = "First Name";
				document.getElementById('lbl_txtfname').innerHTML = strSignupFirstName;
				document.getElementById('lbl_txtfname').style.display = "";
				document.getElementById('lbl_txtfname').style.color=  "#000000";
				document.getElementById('id_txtfname').style.color=  "#000000";
			break;
			case "SL?":
				boolLastName = 1;
				objField.value = "";
				objField.accessKey = "SL";
				strSignupLastName = "Last Name";
				document.getElementById('lbl_txtlname').innerHTML = strSignupLastName;
				document.getElementById('lbl_txtlname').style.display = "";
				document.getElementById('lbl_txtlname').style.color=  "#000000";
				document.getElementById('id_txtlname').style.color=  "#000000";
			break;
			case "SE?":
				boolEmail = 1;
				objField.value = "";
				objField.accessKey = "SE";
				strSignupEmail = "Email";
				document.getElementById('lbl_txtemail').innerHTML = strSignupEmail;
				document.getElementById('lbl_txtemail').style.display = "";
				document.getElementById('lbl_txtemail').style.color=  "#000000";
				document.getElementById('id_txtemail').style.color=  "#000000";
				if (document.getElementById('id_txtpassword').value)
					document.getElementById('lbl_txtpassword').innerHTML = "";
			break;
			case "SP?":
				boolPassword = 1;
				objField.value = "";
				objField.className = "input" ;
				objField.accessKey = "SP";
				strSignupPassword = "Password";
				document.getElementById('lbl_txtpassword').innerHTML = strSignupPassword;
				document.getElementById('lbl_txtpassword').style.display = "";
				document.getElementById('lbl_txtpassword').style.color=  "#000000";
				document.getElementById('id_txtpassword').style.color=  "#000000";
			break;
		}		
	}
	
	function fnShowCapcha()
	{ 
		if(fnValidateFieldInput())
		{
			document.getElementById('registerfielddiv').style.display = "none";
			document.getElementById('registercapchadiv').style.display = "";
			document.getElementById('registercapchadiv').align = "center";			
			document.getElementById("newlogin").style.display='none';
			
			try{
				document.getElementById("id_newlogin").style.display='none';
				document.getElementById("error_row").style.display='none';
				
				document.getElementById("id_mainTable").style.width= "30%";
			}
			catch(e){
				document.getElementById("loginseperator").style.display='none';
			}
			
			fnGenerateNewCaptcha();
			
		}
		return false;
	}	
	
	function fnGenerateNewCaptcha()
	{ 
		ajaxObjects[1] = new sack();
		if(siteid=='sg')
		{
			ajaxObjects[1].requestFile = justsitename+"/index.php?action=generateCaptcha&mode=ajax";
		}
		else
		{
			ajaxObjects[1].requestFile = sitename+"/index.php?action=generateCaptcha&mode=ajax";
		} 
		ajaxObjects[1].onCompletion = function(){  		
													document.getElementById("id_captcha_image").src = ajaxObjects[1].response;
												};
		ajaxObjects[1].runAJAX();	
	}
	
	function fnHideCapcha()
	{
		document.getElementById('registerfielddiv').style.display = "";
		document.getElementById('newlogin').style.display = "";
		document.getElementById('registercapchadiv').style.display = "none";		
		
		document.getElementById('loginseperator').style.display = "";
		
		if(document.getElementById("id_mainTable").style.height)
		{
			document.getElementById("id_mainTable").style.height="";
		}
		if(document.getElementById("id_mainTable").style.width)
		{
			document.getElementById("id_mainTable").style.width= "";	
		}
		
		try{
			document.getElementById("error_row").style.display='';
			if(document.getElementById("error_row").childNodes[0].id == "id_capchamsg")
				document.getElementById("id_capchamsg").style.display = "none";
				
			document.getElementById("id_newlogin").style.display= "";
			
			document.getElementById("id_mainTable").style.width= "80%";
		}
		catch(e){
		}
		
		return false
	}
	
// ADDED BY CHANDAN 18-06-2009
	function fnValidateSignUpInputString(string)
	{
		var strLen = string.length
		var iUNChars = ",\":<>{}&";
		for (var i = 0; i < strLen; i++) 
		{
			if (iUNChars.indexOf(string.charAt(i)) != -1) 
			{
				return false;
			}
		}
		return true;
	}	
	
	function fnValidateFieldInput()
	{ 
		var strSignupFirstName = "First Name";
		var strSignupLastName = "Last Name";
		var strSignupEmail = "Email";
		var strSignupPassword = "Password";
		var strErrorMessage = ""
 		var strFnameNumericVal = "";
		enmIsError = true;
		
		if(document.getElementById('id_txtfname').value == "" || document.getElementById('id_txtfname').accessKey == "SF?")
		{
			strSignupFirstName = "<font color='red'>Enter First Name.</font>";
			enmIsError = false;
		}
		else
		{
			if(boolFirstName == 0 && document.getElementById('id_txtfname').accessKey == "SF?")
			{
				strSignupFirstName = "<font color='red'>Enter First Name.</font>";
				enmIsError = false;
			}
		}
			
			
		if(strSignupFirstName != "")
		{
			document.getElementById('lbl_txtfname').innerHTML = strSignupFirstName;
			document.getElementById('lbl_txtfname').style.display = "";
		}
			
		if(document.getElementById('id_txtlname').value == "" || document.getElementById('id_txtlname').accessKey == "SL?")
		{
			strSignupLastName = "<font color='red'>Enter Last Name.</font>";
			enmIsError = false;
		}
		else
		{
			if(boolLastName == 0 && document.getElementById('id_txtlname').accessKey == "SL?")
			{
				strSignupLastName = "<font color='red'>Enter Last Name.</font>";
				enmIsError = false;
			}
		}
			
		if(strSignupLastName != "")
		{
			document.getElementById('lbl_txtlname').innerHTML = strSignupLastName;
			document.getElementById('lbl_txtlname').style.display = "";
		}
			
		if ( document.getElementById('id_txtemail').value == "" || document.getElementById('id_txtemail').accessKey == "SE?")
		{
			strSignupEmail = "<font color='red'>Enter Email Id.</font>";
			enmIsError = false;
		}
		else
		{
			if(boolEmail == 0 && document.getElementById('id_txtemail').accessKey == "SE?")
			{
				strSignupEmail = "<font color='red'>Enter Email Id.</font>";
				enmIsError = false;
			}
			else
			{
				var emailStr = document.getElementById('id_txtemail').value;
				
				if(!fnLoginEmailCheck (emailStr))
				{
					strSignupEmail = "<font color='red'>Enter Valid Email.</font>";
					enmIsError = false;
				}
			}
		}
			
		if(strSignupEmail != "")
		{
			document.getElementById('lbl_txtemail').innerHTML = strSignupEmail;
			document.getElementById('lbl_txtemail').style.display = "";
		}
			
			
		if ( document.getElementById('id_txtpassword').value == "" || document.getElementById('id_txtpassword').accessKey == "SP?")
		{
			strSignupPassword = "<font color='red'>Enter Password.</font>";
			intIsPass = 1;
			enmIsError = false;
		}
		else
		{
			if(boolPassword == 0 && document.getElementById('id_txtpassword').accessKey == "SP?")
			{
				strSignupPassword = "<font color='red'>Enter Password.</font>";
				enmIsError = false;
				intIsPass = 1;
			}
		}
			
		var strPass = document.getElementById('id_txtpassword').value;
		var strPasslenght = strPass.length;
		if(strPasslenght > 20 || strPasslenght < 4)
		{
			strSignupPassword = "<font color='red'>min. 4 - 20 characters long.</font>";
			enmIsError = false;
		}
		
		if(!fnValidateSignUpInputString(strPass))
			{
				

				strSignupPassword = "<font color='red'>{}:\"<>? characters not allowed.</font>";
				enmIsError = false;
			}
			

		if(strSignupPassword != "")
		{
			document.getElementById('lbl_txtpassword').innerHTML = strSignupPassword;
			document.getElementById('lbl_txtpassword').style.display = "";
		}
		
		if(enmIsError == true)
		{
			return true;
		}
		return false;
	}
	
	
	boolFirstName = 0;
	boolLastName = 0;
	boolEmail = 0;
	boolPassword = 0;
	boolLoginEmail = 0;
	boolLoginPassword = 0;
		
	function fnOnBlurLoginField(objField)
	{
		strFieldValue = objField.value;
		if(objField.value == "")
		{
			switch(objField.accessKey)
			{
				case "LE":
					objField.value = "Email?";
					objField.accessKey = "LE?";
					boolLoginEmail = 0;
					strLoginEmail = "Email";
					document.getElementById('lbl_txtloginemail').innerHTML = strLoginEmail;
					document.getElementById('lbl_txtloginemail').style.display = "none";
					document.getElementById('lbl_txtloginemail').style.color=  "#686e75";
					document.getElementById('id_txtloginemail').style.color=  "#686e75";
				break;
				case "LP":
					objField.value = "";
					//////////// added by prachi /////////
					var ua = navigator.userAgent.toLowerCase();
					if (ua.indexOf('safari/') != -1){
						objField.className = "passwordbgSafari";
					}else{
						objField.className = "passwordbg";	
					}
					//////////// added by prachi /////////
					//objField.className = "passwordbg";
					objField.accessKey = "LP?";
					boolLoginPassword = 0;
					strLoginPassword = "Password";
					document.getElementById('lbl_txtloginpassword').innerHTML = strLoginPassword;
					document.getElementById('lbl_txtloginpassword').style.display = "none";
					document.getElementById('lbl_txtloginpassword').style.color=  "#686e75";
					document.getElementById('id_txtloginpassword').style.color=  "#686e75";
				break;
				case "SF":
					objField.value = "First Name?";
					objField.accessKey = "SF?";
					boolFirstName = 0;
					strSignupFirstName = "First Name";
					document.getElementById('lbl_txtfname').innerHTML = strSignupFirstName;
					document.getElementById('lbl_txtfname').style.display = "none";
					document.getElementById('lbl_txtfname').style.color=  "#686e75";
					document.getElementById('id_txtfname').style.color=  "#686e75";
				break;
				case "SL":
					objField.value = "Last Name?";
					objField.accessKey = "SL?";
					boolLastName = 0;
					strSignupLastName = "Last Name";
					document.getElementById('lbl_txtlname').innerHTML = strSignupLastName;
					document.getElementById('lbl_txtlname').style.display = "none";
					document.getElementById('lbl_txtlname').style.color=  "#686e75";
					document.getElementById('id_txtlname').style.color=  "#686e75";
				break;
				case "SE":
					objField.value = "Email?";
					objField.accessKey = "SE?";
					boolEmail = 0;
					strSignupPassword = "Email";
					document.getElementById('lbl_txtemail').innerHTML = strSignupPassword;
					document.getElementById('lbl_txtemail').style.display = "none";
					document.getElementById('lbl_txtemail').style.color=  "#686e75";
				document.getElementById('id_txtemail').style.color=  "#686e75";
				break;
				case "SP":
					objField.value = "";
					//////////// added by prachi /////////
					var ua = navigator.userAgent.toLowerCase();
					if (ua.indexOf('safari/') != -1){
						objField.className = "passwordbgSafari";						
					}else{
						objField.className = "passwordbg";
					}
					//////////// added by prachi /////////
					//objField.className = "passwordbg";
					objField.accessKey = "SP?";
					boolPassword = 0;
					strSignupPassword = "Password";					
					document.getElementById('lbl_txtpassword').innerHTML = strSignupPassword;
					document.getElementById('lbl_txtpassword').style.display = "none";
					document.getElementById('lbl_txtpassword').style.color=  "#686e75";
					document.getElementById('id_txtpassword').style.color=  "#686e75";
				break;
			}
		}
	}
	



	var strGoTo;
	var gotosubdomain = "";
	var txtloginemail = "";
	var txtloginpassword = "";
	var chkLoginRemeberMe = "";
	var strloginas = "";
	var ajaxObjects = new Array();
	var gotoeditorials = "";
	
	function fnValidateLoginMeinInput()
	{  

		strLoginEmail = "";	
		strLoginPassword = "";
		isNext = 1;
		
		
		if ( document.getElementById('id_txtloginemail').value == "" || document.getElementById('id_txtloginemail').accessKey == "LE?")
		{
			strLoginEmail = "<font color='red'>Enter Email Id.</font>";
		}
		else
		{
			if(boolLoginEmail == 0 && document.getElementById('id_txtloginemail').accessKey == "LE?")
			{
				strLoginEmail = "<font color='red'>Enter Email Id.</font>";
			}
			else
			{
				var emailStr = document.getElementById('id_txtloginemail').value;
				
				if(!fnLoginEmailCheck (emailStr))
				{
					strLoginEmail = "<font color='red'>Enter Valid Email .</font>";
				}
			}
		}
			
		if(strLoginEmail != "")
		{
			document.getElementById('lbl_txtloginemail').innerHTML = strLoginEmail;
			document.getElementById('lbl_txtloginemail').style.display = "";
		}
			
		if ( document.getElementById('id_txtloginpassword').value == "" || document.getElementById('id_txtloginpassword').accessKey == "LP?")
		{
			strLoginPassword = "<font color='red'>Enter Password.</font>";
			intIsPass = 1;
		}
		else
		{
			if(boolPassword == 0 && document.getElementById('id_txtloginpassword').accessKey == "LP?")
			{
				strLoginPassword = "<font color='red'>Enter Password.</font>";
				intIsPass = 1;
			}
			
		}
			
		if(strLoginPassword != "")
		{
			document.getElementById('lbl_txtloginpassword').innerHTML = strLoginPassword;
			document.getElementById('lbl_txtloginpassword').style.display = "";
		}


	if(strLoginPassword == "" && strLoginEmail == "")
		{ 
			// FOR LOADER IMAGE DIV
			fnShowDefauleLoaderImage("id_LoginButton","id_LoginLoader");
			
			// VIKRANT HAVE CHANGE THIS TO HAVE EVERYTHING ON ONE POPUP
			strGoTo = document.getElementById('id_gotologin').value;
			
			if(document.getElementById('id_gotoeditorials'))
			{
				gotoeditorials = document.getElementById('id_gotoeditorials').value;
			}
			gotosubdomain = document.getElementById('id_gotosubdomain').value;
			
			
			
			txtloginemail = Base64.encode(document.getElementById('id_txtloginemail').value);
			txtloginpassword = Base64.encode(document.getElementById('id_txtloginpassword').value);
			
			chkLoginRemeberMe = document.getElementById('id_chkLoginRemeberMe').value;
			var btnLogin_x = 1;
			ajaxObjects[1] = new sack();
			ajaxObjects[1].requestFile = sitename+"/index.php?action=login&mode=ajax&byajax=1&txtloginemail="+txtloginemail+"&txtloginpassword="+txtloginpassword+"&goto="+strGoTo+"&chkLoginRemeberMe="+chkLoginRemeberMe+"&btnLogin_x="+btnLogin_x+"&gotosubdomain="+gotosubdomain+"&gotoeditorials="+gotoeditorials;
			ajaxObjects[1].onCompletion = function(){
														fnGetFurtherLoginAction(ajaxObjects[1].response);
													};
			ajaxObjects[1].runAJAX();
			return false;
		}
		return false;
	}
	
	function fnGetFurtherLoginAction(response)
	{
		var intErrorCode = parseInt(response);
		//alert(intErrorCode);
		fnProcessAjaxCode(intErrorCode);
	}
	
	function fnSpamCommentAdminType(strlastchance)
	{
		ajaxObjects[5] = new sack();
		var strUrl = sitename+"/index.php?action=selectcommentadmintype&ajax=1&mode=ajax&lt="+strlastchance;
		ajaxObjects[5].requestFile = strUrl;
		ajaxObjects[5].onCompletion = function(){ 
													document.getElementById("divRegisterLogin").innerHTML = ajaxObjects[5].response;
												};																											
		ajaxObjects[5].runAJAX();
		
		
		
	}
	
	function fnSpamUpdateAdminType(strlastchance,strbackurl)
	{
		ajaxObjects[7] = new sack();
		var strUrl = sitename+"/index.php?action=selectcommentadmintype&mode=ajax&ajax=1&lt="+strlastchance+"&backurl="+strbackurl;
		ajaxObjects[7].requestFile = strUrl;
		ajaxObjects[7].onCompletion = function(){ 
													document.getElementById("divRegisterLogin").innerHTML = ajaxObjects[7].response;													
												};																											
		ajaxObjects[7].runAJAX();
	}
	
	function fnTestCompose(straction,intuserid)
	{
		document.getElementById("id_gotologin").value = Base64.encode("action=compose&oc=1&u=")+intuserid;
		document.getElementById("id_gotoregister").value = Base64.encode("action=compose&oc=1&");	
		document.getElementById("id_SendMsg").value = "u="+Base64.decode(intuserid);	
		Lightbox.showBoxByID('divRegisterLogin',intLoginPopupWidth, intLoginPopupHeight);
	}
	
	
	
	function fnProcessAjaxCode(intErrorCode)
	{	
		
		var strQueryString = "";
		switch(intErrorCode)
		{			
		
			case 1:
				if(strErrorMessage == "")
					strErrorMessage = "<B>Incorrect Email/Password Combination.</B><br />Justmeans passwords are case sensitive. Please check your CAPS lock key.<br/>"
				strQueryString = "popupmsg="+strErrorMessage+"&goto="+strGoTo;
				if (strLoginAction == "")
					location.href = sitename+"/index.php?action=logmein&"+strQueryString;
				else
					location.href = sitename+"/index.php?action="+strLoginAction+"&"+strQueryString;
			break;
			
			case 2:
				strErrorMessage = "You have been denied a profile on Justmeans because of improper use of the platform in the past. If you would like to contest this status, please email techsupport@justmeans.com<br/>"
				strQueryString = "popupmsg="+strErrorMessage+"&goto="+strGoTo;
				location.href = sitename+"/index.php?action=logmein&"+strQueryString;
			break;
			
			case 3: // NOT ANY ACTION	
				/*if(document.getElementById('id_hdnabove').value == "y")
				{
					location.href = sitename+"/myprofile";
				}
				else
				{*/
					//alert(sitename+"/index.php?action="+Base64.decode(strGoTo));
					location.href = sitename+"/index.php?"+Base64.decode(strGoTo);
				//}
				
			break;
			
			case 4: // ADMIN			
				location.href = sitename+"/index.php?action=adminhome";
			break;	
			
			case 5: // SUBDOMAIN
				location.href = "http://"+gotosubdomain;
			break;	
			
			case 6: //$_SESSION['SESALLEXTERNINFO']['FOREVENTNETWORKING']
					
					location.href = sitename+"/index.php?action=setusereventmap&goto="+Base64.decode(strGoTo);
			break;	
			
			case 7: //$_SESSION["SESALLEXTERNINFO"]["FORFOLLOW"]
			    if(gotoeditorials)
				{ 
					location.href = sitename+"/index.php?action=addfollowuser&gotoeditorials="+strGoTo;
				}
				else
				{
					location.href = sitename+"/index.php?action=addfollowuser&goto="+strGoTo;
				}
				
			break;	
			
			case 8: //$_SESSION['SESALLEXTERNINFO']['FORCOMMENTS']
				//location.href = sitename+"/addallcomments";
				
				ajaxObjects[4] = new sack();
				if(siteid!='sg')
				{
					var strUrl = sitename+"/index.php?action=addallcomments&look=1&mode=ajax";
				}
				else
				{
					var strUrl = justsitename+"/index.php?action=addallcomments&look=1&mode=ajax&selectcommenttype=i";
				}
			
				ajaxObjects[4].requestFile = strUrl;
				ajaxObjects[4].onCompletion = function(){ 
															var totalresponse = ajaxObjects[4].response;
															var mytool_array = totalresponse.split("|");															
															var lookup = parseInt(mytool_array[0]);
															var parentlookup = parseInt(mytool_array[1]);										
															if(siteid=='sg')
															{
																lookup=7;
															}
															if (isNaN(lookup))
																lookup = 0;
															
															 switch(lookup)
															 {
																case 0:
																	window.location.reload();
																break;
																case 1:
																	ajaxObjects[5] = new sack();
																	var strUrl = sitename+"/index.php?action=selectcommentadmintype&ajax=1&mode=ajax";
																	ajaxObjects[5].requestFile = strUrl;
																	ajaxObjects[5].onCompletion = function(){ 
																												document.getElementById("divRegisterLogin").innerHTML = ajaxObjects[5].response;
																											};																											
																	ajaxObjects[5].runAJAX();																										
																break;
																
																case 2:
																	location.href = sitename+"/index.php?action=companyprofile";
																break;
																
																case 555:
																	var strPageLocation = window.location;
																	strPageLocation = strPageLocation.toString();
																	strTmpLocation = strPageLocation.replace(sitename+"/", "");
																	arrSplitup = strTmpLocation.split("?");
															 		strTmpLocation = (arrSplitup[0]);
																	strTmpLocation = strTmpLocation.replace("?", "&");										
																	strPageLocation = sitename+"/"+strTmpLocation+"?se="+parentlookup;
																	window.location.href = strPageLocation;
																break;
															
																case 666:
																	var strPageLocation = window.location;
																	strPageLocation = strPageLocation.toString();
																	strTmpLocation = strPageLocation.replace(sitename+"/", "");
																	arrSplitup = strTmpLocation.split("?");
															 		strTmpLocation = (arrSplitup[0]);
																	strTmpLocation = strTmpLocation.replace("?", "&");										
																	strPageLocation = sitename+"/"+strTmpLocation+"?se="+parentlookup;
																	window.location.href = strPageLocation;
																break;
															
																case 999:
																location.href = sitename+"/index.php?action=logout&spamerror=1";
																break;
															
																case 88:
																	var strPageLocation = window.location;
																	strPageLocation = strPageLocation.toString();
																	strTmpLocation = strPageLocation.replace(sitename+"/", "");
																	arrSplitup = strTmpLocation.split("?");
															 		strTmpLocation = (arrSplitup[0]);
																	strTmpLocation = strTmpLocation.replace("?", "&");										
																	strPageLocation = sitename+"/"+strTmpLocation+"?se="+parentlookup;
																	window.location.href = strPageLocation;
																break;
																case 7:
																	window.location.href = ajaxObjects[4].response;
																	window.location.reload();
																	//&se="+parentlookup
																break;
																default:
																	window.location.href = ajaxObjects[4].response;
																	//alert(window.location.href);
																	return false;
																	// AMOL ADDED THIS CONDITIONS
																	if(window.location.href == "")
																	{
																		window.location.reload()
																	}
																	//
																	
																	//&se="+parentlookup
																break;
															 }
															 
														};
														
														
				ajaxObjects[4].runAJAX();
				
			break;	
			
			case 9: //$_SESSION['SESALLEXTERNINFO']['FORCOMMENTVOTING']
				location.href = sitename+"/index.php?action=mediacommentvote";
			break;	
			
			case 10: // $enumUserType == 'I' && $_SESSION['SESALLEXTERNINFO']['FORWGWRUD']
				ajaxObjects[6] = new sack();
				var strUrl = sitename+"/index.php?action=addwhatuserworkingon&look=1&mode=ajax";
				//alert(strGoTo);
				ajaxObjects[6].requestFile = strUrl;
				ajaxObjects[6].onCompletion = function(){ 
															//alert(ajaxObjects[6].response);
															 var lookup = ajaxObjects[6].response;
															 arrLookup = lookup.split(" | ");
															 intLookUp = parseInt(arrLookup[0]);
															 var parentlookup = parseInt(arrLookup[1]);	
															 //parentlookup = Base64.encode(parentlookup);								 
															 switch(intLookUp)
															 {
																case 1:																	
																	ajaxObjects[7] = new sack();
																	var strUrl = sitename+"/index.php?action=selectcommentadmintype&mode=ajax&ajax=1&backurl="+arrLookup[1];
																	ajaxObjects[7].requestFile = strUrl;
																	ajaxObjects[7].onCompletion = function(){ 
																													Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
																													document.getElementById("divRegisterLogin").innerHTML = ajaxObjects[7].response;
																												
																											};																											
																	ajaxObjects[7].runAJAX();												
																break;																
																case 2:
																	location.href = sitename+"/index.php?action=companyprofile";
																break;
																
																case 555:																	
																	var strPageLocation = window.location;
																	strPageLocation = strPageLocation.toString();
																	
																	if (strPageLocation.indexOf("myprofile") != -1)
																		strPageLocation = sitename+"/myprofile?feed=1&se="+parentlookup;
																	else if (strPageLocation == sitename+"/" || strPageLocation == sitename)
																		strPageLocation = sitename+"/index.php?action=userhomepageV6&isnewu=1&se="+parentlookup;
																	else if (strPageLocation.indexOf("userhomepageV6") != -1)
																		strPageLocation = sitename+"/index.php?action=userhomepageV6&isnewu=1&se="+parentlookup;
																	else if (strPageLocation.indexOf("#") == -1)
																		strPageLocation = window.location+"&se="+parentlookup;
																	else
																	{
																		strTmpLocation = strPageLocation.replace(sitename+"/", "");

																		strTmpLocation = strTmpLocation.replace("?", "&");
																		strPageLocation = sitename+"/index.php?action="+strTmpLocation+"&se="+parentlookup;
																	}
																	
																	window.location.href = strPageLocation;																
																break;
															
																case 666:
																var strPageLocation = window.location;
																	strPageLocation = strPageLocation.toString();
																	
																	
																	if (strPageLocation.indexOf("myprofile") != -1)
																		strPageLocation = sitename+"/myprofile?feed=1&se="+parentlookup;
																	else if (strPageLocation == sitename+"/" || strPageLocation == sitename)
																		strPageLocation = sitename+"/index.php?action=userhomepageV6&isnewu=1&se="+parentlookup;
																	else if (strPageLocation.indexOf("userhomepageV6") != -1)
																		strPageLocation = sitename+"/index.php?action=userhomepageV6&isnewu=1&se="+parentlookup;
																	else if (strPageLocation.indexOf("#") == -1)																																			
																		strPageLocation = window.location+"&se="+parentlookup;
																	else
																	{
																		strTmpLocation = strPageLocation.replace(sitename+"/", "");
																		strTmpLocation = strTmpLocation.replace("?", "&");
																		strPageLocation = sitename+"/index.php?action="+strTmpLocation+"&se="+parentlookup;
																	}
																	
																	window.location.href = strPageLocation;
																break;
															
																case 999:
																location.href = sitename+"/index.php?action=logout&spamerror=1";
																break;
															
																case 88:
																	var strPageLocation = window.location;
																	strPageLocation = strPageLocation.toString();
																	
																	if (strPageLocation.indexOf("myprofile") != -1)
																		strPageLocation = sitename+"/myprofile?feed=1&se="+parentlookup;
																	else if (strPageLocation == sitename+"/" || strPageLocation == sitename)
																		strPageLocation = sitename+"/index.php?action=userhomepageV6&isnewu=1&se="+parentlookup;
																	else if (strPageLocation.indexOf("userhomepageV6") != -1)
																		strPageLocation = sitename+"/index.php?action=userhomepageV6&isnewu=1&se="+parentlookup;
																	else if (strPageLocation.indexOf("#") == -1)
																		strPageLocation = window.location+"&se="+parentlookup;
																	else
																	{
																		strTmpLocation = strPageLocation.replace(sitename+"/", "");
																		strTmpLocation = strTmpLocation.replace("?", "&");
																		strPageLocation = sitename+"/index.php?action="+strTmpLocation+"&se="+parentlookup;
																	}
																	
																	window.location.href = strPageLocation;
																break;
																
																default:
																	var strPageLocation = window.location;
																	strPageLocation = strPageLocation.toString();
																	
																	if (strPageLocation.indexOf("myprofile") != -1)
																		strPageLocation = sitename+"/myprofile?feed=1";
																	else if (strPageLocation == sitename+"/" || strPageLocation == sitename)
																		strPageLocation = sitename+"/index.php?action=userhomepageV6&isnewu=1";
																	else if (strPageLocation.indexOf("userhomepageV6") != -1)
																		strPageLocation = sitename+"/index.php?action=userhomepageV6&isnewu=1";
																	else if (strPageLocation.indexOf("#") == -1)
																		strPageLocation = window.location;
																	else
																	{
																		strTmpLocation = strPageLocation.replace(sitename+"/", "");
																		strTmpLocation = strTmpLocation.replace("?", "&");
																		strPageLocation = sitename+"/index.php?action="+strTmpLocation;
																	}
																	window.location.href = strPageLocation;
																break;
															 }
															 
														};
				ajaxObjects[6].runAJAX();
			break;	
			
			case 11: // $enumUserType == 'I' && $_SESSION['SESALLEXTERNINFO']['FORCONNECTUSER']
				location.href = sitename+"/index.php?action=sendconnecttouser";
			break;	
			
			case 12: // $enumUserType == 'I' && $_SESSION['SESALLEXTERNINFO']['FORREPLYTOCONNECT']
				location.href = sitename+"/index.php?action=addreplytoconnect";
			break;	
			
			case 13: // $enumUserType == 'I' && $_SESSION['SESALLEXTERNINFO']['FORJOBMAILS'] == 1
				location.href = sitename+"/index.php?action=index.php&"+Base64.decode(strGoTo)+"&sendmail=1";
			break;				
			
			case 14: //$_SESSION['SESALLEXTERNINFO']['FORWGWRUD']
				location.href = sitename+"/index.php?action=addwhatuserworkingon";
			break;				

			case 15: //$_SESSION['SESALLEXTERNINFO']['FORCONNECTUSER']
				location.href = sitename+"/index.php?action=sendconnecttouser";
			break;

			case 16: //$_SESSION['SESALLEXTERNINFO']['FORREPLYTOCONNECT']
				location.href = sitename+"/index.php?action=addreplytoconnect";
			break;
			
			case 17: //clsUtil::fnRedirect(clsUtil::fnBuildUrl("myprofile"));
				location.href = sitename+"/index.php?action=myprofile";
			break;	
			
			case 18: //clsUtil::fnRedirect(clsUtil::fnBuildUrl("myprofile","newsalert=1"));
				location.href = sitename+"/index.php?action=myprofile&newsalert=1";
			break;
			
			case 19: //clsUtil::fnRedirect(clsUtil::fnBuildUrl("myprofile","newsalert=1"));
				//location.href = sitename+"/myprofile";
				//location.href = sitename;
				
				try
				{
					if(document.getElementById('id_hdnabove').value == "y")
					{
						location.href = sitename+"/myprofile";
					}
					else
					{
						location.href = sitename;
					}
				}
				catch(e)
				{
				}
				
			break;
			
			case 20: //$enumUserType == 'C'
				location.href = sitename+"/index.php?action=companyprofile";
			break;

			case 21: //$enumUserType == 'C'
				location.href = sitename+"/index.php?action=companyprofile";
			break;

			case 22: //$enumUserType == 'SA'||$enumUserType == 'BA'
						location.href = sitename+"/index.php?action=adminhome";
			break;
			
			case 23: //$enumUserType == 'SA'||$enumUserType == 'BA'
				location.href = sitename+"/index.php?action=adminhome";
			break;
			
			case 24: //DUAL LOGIN
				ajaxObjects[2] = new sack();
				var strUrl = sitename+"/selectusertype?goto="+strGoTo+"&mode=ajax&gotosubdomain="+gotosubdomain+"&gotoeditorials="+gotoeditorials;
				ajaxObjects[2].requestFile = strUrl;
				ajaxObjects[2].onCompletion = function(){ 
															document.getElementById("divRegisterLogin").innerHTML = ajaxObjects[2].response;
														};
				ajaxObjects[2].runAJAX();
			break;			
			
			case 25: //FOR COMPANY BACKEND ADD COMMENT
				ajaxObjects[8] = new sack();
				//var strUrl = sitename+"/selectcommentadmintype?ajax=1&backurl="+strGotoUrl;
				var strUrl = sitename+"/index.php?action=selectcommentadmintype&mode=ajax&ajax=1&backurl="+strGotoUrl;
				ajaxObjects[8].requestFile = strUrl;
				ajaxObjects[8].onCompletion = function(){ 
															document.getElementById("divRegisterLogin").innerHTML = ajaxObjects[8].response;
														};																											
				ajaxObjects[8].runAJAX();		
			break;			
			
			case 26: //$enumUserType == 'C'
				location.href = sitename+"/index.php?action=addremovegoodwork";
			break;

			case 27: //Seventh Generation sgadminhome added by Anandkumar Jadhav
				location.href = sitename+"/index.php?action=sgadminhome";
			break;

			case 28: // Seventh Generation sglogmein added by Anandkumar Jadhav
				strErrorMessage = "<B>Incorrect Email/Password Combination.</B><br />Seventh Generation passwords are case sensitive. Please check your CAPS lock key.<br/>"
				strQueryString = "popupmsg="+strErrorMessage+"&goto="+strGoTo;
				location.href = sitename+"/index.php?action=sglogmein&"+strQueryString;
			break;
			

			case 29: // Seventh Generation sglogmein added by Anandkumar Jadhav
				strErrorMessage = "You have been denied a profile on Seventh Generation because of improper use of the platform in the past. If you would like to contest this status, please email techsupport@seventhgeneration.com<br/>"
				strQueryString = "popupmsg="+strErrorMessage+"&goto="+strGoTo;
				location.href = sitename+"/index.php?action=sglogmein&"+strQueryString;
			break;
			
			case 30: // ADD GOOD WORK COMMENT [SAGAR 13-May-2009]
				ajaxObjects[9] = new sack();
				ajaxObjects[9].requestFile = sitename+"/index.php?action=addgoodworkcomment";
				ajaxObjects[9].onCompletion = function(){ window.location.reload();	};
				ajaxObjects[9].runAJAX();
			break;
			
			case 31: // ADD EXTERNAL COMMENT FROM NEWS FEED [SAGAR 15-May-2009]
				ajaxObjects[10] = new sack();
				ajaxObjects[10].requestFile = sitename+"/index.php?action=addexternalcomment";
				ajaxObjects[10].onCompletion = function(){ window.location.reload();	};
				ajaxObjects[10].runAJAX();
			break;
			
			case 32: // ADD EXTERNAL COMMENT FROM NEWS FEED [SAGAR 15-May-2009]				
				location.href = sitename+"/editorial/?"+Base64.decode(strGoTo); 
			break;
			
			case 33: //$_SESSION["SESALLEXTERNINFO"]["FORFOLLOW"]
				location.href = sitename+"/index.php?action=addfollowmedia&goto="+strGoTo;
			break;
			case 34: // $enumUserType == 'I' && $_SESSION['SESALLEXTERNINFO']['FORSGWGWRUD'] [ANAND 02-Jun-2009]
				ajaxObjects[6] = new sack();
				var strUrl = sitename + "/index.php?action=sgaddwhatuserdoing&look=1&mode=ajax";
				//alert(strGoTo);
				ajaxObjects[6].requestFile = strUrl;
				ajaxObjects[6].onCompletion = function(){ 
															 var lookup = ajaxObjects[6].response;
															 arrLookup = lookup.split(" | ");
															 intLookUp = parseInt(arrLookup[0]);
				
															 var parentlookup = parseInt(arrLookup[1]);	
															 //parentlookup = Base64.encode(parentlookup);								 
															
															 switch(intLookUp)
															 {
																
																case 555:																	
																	var strPageLocation = window.location;
																	strPageLocation = strPageLocation.toString();
																	strTmpLocation = strPageLocation.replace(sitename+"/", "");
																	strTmpLocation = strTmpLocation.replace("?", "&");
																	strPageLocation = sitename+"/index.php?action="+strTmpLocation+"&se="+parentlookup;
																	window.location.href = strPageLocation;																
																break;
															
																case 666:
																var strPageLocation = window.location;
																	strPageLocation = strPageLocation.toString();
																	strTmpLocation = strPageLocation.replace(sitename+"/", "");
																	strTmpLocation = strTmpLocation.replace("?", "&");
																	strPageLocation = sitename+"/index.php?action="+strTmpLocation+"&se="+parentlookup;
																	window.location.href = strPageLocation;
																break;
															
																case 999:
																	location.href = sitename+"/index.php?action=sglogout&spamerror=1";
																break;
															
																case 88:
																	var strPageLocation = window.location;
																	strPageLocation = strPageLocation.toString();
																	strTmpLocation = strPageLocation.replace(sitename+"/", "");
																	strTmpLocation = strTmpLocation.replace("?", "&");
																	strPageLocation = sitename+"/index.php?action="+strTmpLocation+"&se="+parentlookup;
																	window.location.href = strPageLocation;
																break;
																
																default:
																	var strPageLocation = window.location;
																	strPageLocation = strPageLocation.toString();
																	strTmpLocation = strPageLocation.replace(sitename+"/", "");
																	strTmpLocation = strTmpLocation.replace("?", "&");
																	if(strTmpLocation!='seventhgeneration' && strTmpLocation!='')
																	strPageLocation = sitename+"/index.php?action=sgchangewithus";
																	else
																	strPageLocation = sitename+"/index.php?action=seventhgeneration";
																	//var strPageLocation = "sgchangewithus";
																	//strPageLocation = strPageLocation.toString();
																	//strTmpLocation = strPageLocation.replace(sitename+"/", "");
																	//strTmpLocation = strTmpLocation.replace("?", "&");
																	//strPageLocation = sitename+"/"+strPageLocation;
																	//var successmsg="Good Work successfully uploaded.";
																	//window.location.href = strPageLocation+"&successmsg="+successmsg;
																	window.location.href = strPageLocation;
																break;
															 }
															 
														};
				ajaxObjects[6].runAJAX();
			break;	
			case 35:
				location.href = sitename + "/sgmyprofile?am=" + Base64.encode("mbp"); 
			break;
			
			case 36:
				location.href = sitename + "/sgcommitbestpractice"; 
			break;
			
			case 37:
				location.href = sitename + "/ajaxcontest?isvote=y"; 
			break;
			
			case 777:
				strErrorMessage = "<B>Your account on Justmeans has been blocked because of improper use of this platform in the past. If you would like to reactivate your account, please email us at techsupport@justmeans.com <br/>"
				strQueryString = "popupmsg="+strErrorMessage+"&goto="+strGoTo;
				location.href = sitename+"/index.php?action=logmein&"+strQueryString;
			break;
			
			case 888:
				strErrorMessage = "<B>Your IPhas been blocked because of improper use of this platform in the past. If you would like to reactivate your account, please email us at techsupport@justmeans.com <br/>"
				strQueryString = "popupmsg="+strErrorMessage+"&goto="+strGoTo;
				location.href = sitename+"/index.php?action=logmein&"+strQueryString;
			break;			
			
			default:
				//location.href = sitename+"/myprofile";
				location.href = sitename;
			break;
			  
		}	
	}
	
	function fnGoLogin(strSelection)
	{
		fnShowDefauleLoaderImage("id_LoginButton","id_LoginLoader");
		ajaxObjects[3] = new sack();
		var strUrl = sitename+"/index.php?action=selectusertype&mode=ajax&btnSave=1&chkLoginRemeberMe="+chkLoginRemeberMe+"&rdbSelectType="+strSelection+"&goto="+strGoTo+"&gotosubdomain="+gotosubdomain+"&gotoeditorials="+gotoeditorials;
		ajaxObjects[3].requestFile = strUrl;
		ajaxObjects[3].onCompletion = function(){ 
													var intErrorCode = parseInt(ajaxObjects[3].response);
													fnProcessAjaxCode(intErrorCode);
												};
		ajaxObjects[3].runAJAX();
	}
	
	
	var intTotalCnt;
	function checkUncheckSelectUserType(strSelection)
	{
			// require at least one radio button be selected
			var radioSelected = false;
			for (i = 0;  i < document.frmSelectType.rdbSelectType.length;  i++)
			{
				if (document.frmSelectType.rdbSelectType[i].checked)
					radioSelected = true;
			}
			if (!radioSelected)
			{
				alert("Please select Login as.");
				return false;
			}			
			fnGoLogin(strSelection)
	}
	
	
	function checkUncheckAllSelectCommentType(strlastchance)
	{
		
		fnShowDefauleLoaderImage("id_LoginButton","id_LoginLoader");
		// require at least one radio button be selected
		var radioSelected = false;
		for (i = 0;  i < document.frmSelectCommentAdminType.rdbSelectType.length;  i++)
		{
			if (document.frmSelectCommentAdminType.rdbSelectType[i].checked)
				radioSelected = true;
		}
		if (!radioSelected)
		{
			alert("Choose \"Display this comment as\" from following options.");
			return false;
		}
		else if(strlastchance == "lastchance")
		{
			document.getElementById('id_ErrorMessageSpam').innerHTML = "<b>This is your last chance.</b>";
			boolAutoHide = true;
			ajax_showTooltip("id_ErrorMessageSpam",document.getElementById("id_selectsubmit"),200,45);
			setTimeout("fnHideMessage("+"'id_ErrorMessageSpam')",3000);			
		}
		return true;
	}
		
	
	function fnLoginEmailCheck (emailStr)
	{
		var emailPat=/^(.+)@(.+)$/
		
		var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
		
		var validChars="\[^\\s" + specialChars + "\]"
		
		var quotedUser="(\"[^\"]*\")"
		
		var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
		
		var atom=validChars + '+'
		
		var word="(" + atom + "|" + quotedUser + ")"
		
		var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
		
		var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
		
		
		var matchArray=emailStr.match(emailPat)
		if (matchArray==null) 
		{
		 //alert("Email address seems incorrect (check @ and .'s)")
		  return false
		}
		var user=matchArray[1]
		var domain=matchArray[2]
		
		// See if "user" is valid
		if (user.match(userPat)==null) {
			// user is not valid
			//alert("The username doesn't seem to be valid.")
			return false
		}
		
		/* if the e-mail address is at an IP address (as opposed to a symbolic
		   host name) make sure the IP address is valid. */
		var IPArray=domain.match(ipDomainPat)
		if (IPArray!=null) {
			// this is an IP address
		   for (var i=1;i<=4;i++) {
			 if (IPArray[i]>255) {
				 //alert("Destination IP address is invalid!")
				 return false
			 }
			}
			return true
		}
		
		// Domain is symbolic name
		var domainArray=domain.match(domainPat)
		if (domainArray==null) {
		 //alert("The domain name doesn't seem to be valid.")
			return false
		}
		
		var atomPat=new RegExp(atom,"g")
		var domArr=domain.match(atomPat)
		var len=domArr.length
		if (domArr[domArr.length-1].length<2 ||
			domArr[domArr.length-1].length>4) {
		   // the address must end in a two letter or three letter word.
		   //alert("The address must end in a three-letter domain, or two letter country.")
		   return false
		}
		
		// Make sure there's a host name preceding the domain.
		if (len<2) {
		   var errStr="This address is missing a hostname!"
		   //alert(errStr)
	   return false
	}
	// If we've got this far, everything's valid!
	return true;
}
/*------------ login.js -------------*/

/*------------ ajax.js -------------*/
var ajaxObjects = new Array();
var img = new Image();
img.src = "images/loading.gif";
var contentid;
var extracontent;
var tempajaxaction;
var tempaction;
var globalaction;
var globalajaxaction;
var globalparams;


function fnGetBlockResponse(intactivityid)
{
	var ajaxIndex = ajaxObjects.length;	
	ajaxObjects[ajaxIndex] = new sack();
				//var strUrl = sitename+"/index.php?action=blockuseripajax&mode=ajax&ajax_action=ajaxblock&bt="+strspamflag+"&aid="+intActId;
				var strUrl = sitename+"/blockuseripajax?mode=ajax&ajax_action=checkblock&aid="+intActId;				
				ajaxObjects[ajaxIndex].requestFile = strUrl;
				ajaxObjects[ajaxIndex].onCompletion = function(){ 
															 var lookup = (ajaxObjects[ajaxIndex].response);														 
															 switch(lookup)
															 {
																case "logout":
																	location.href = sitename+"/index.php?action=logout";													
																break;						
																
																default:												
																	//alert(ajaxObjects[ajaxIndex].response);
																	return false;
																	//document.getElementById("id_spamdiv").innerHTML = ajaxObjects[0].response;
																break;
															 }															 
														};									
				ajaxObjects[ajaxIndex].runAJAX();
				return true;
				
}

function fnAjaxCaller(contentelementid, action,ajax_action,params,content,hide_contentid)
{		
	    globalaction = action;
		globalajaxaction = ajax_action;
		globalparams = params;
	  /*
	   contentelementid = Element where response should be displayed //id_divsubindustry
	   action = fuse
	   params = &id=1&name=vikrant
	   ajax_action = action is action function
	   hide_contentid = a comma seperated string divid,divid2,divid3
	  */
	  tempaction = action;
	  tempajaxaction = ajax_action;
	  var d = new Date();
	  var time = d.getTime();
	  contentid = contentelementid;
	  extracontent = content;
	  
	 var hide_content=hide_contentid;

	if(params == "revenue")
	{
		var selectedcountryid = document.getElementById('regioncity').value;
	 
		var selectedsectorid = document.getElementById('id_cmbSector').value;
		
		// REFER TASK 581 on MANTIS
		var selectcountrystring = document.getElementById('lookupCity').value;
		var arrcountrystring= selectcountrystring.split("-");
	    var selectcountry = arrcountrystring[2] ;
	     
		 
		 
		//var selectcountry="United States";
		params = '&city='+selectedcountryid+'&sectorid='+selectedsectorid+'&country='+selectcountry;
		
	}
	
	 if(hide_content != "")
	  {
		  var arrContet = hide_content.split(",");
		  for(var intCtr = 0; intCtr < arrContet.length; intCtr++)
		  {
			//$(arrContet[intCtr]).innerHTML = "";
			//$(arrContet[intCtr]).style.display = "none";
			document.getElementById(arrContet[intCtr]).innerHTML = "";
			document.getElementById(arrContet[intCtr]).style.display = "none";
		  }
	  }


	  var url = sitename+'/index.php?action='+ action +'&mode=ajax&ajax_action='+ ajax_action + params +'&'+time ; 
	  
	  /*var myAjax = new Ajax.Request(url,
	  {
		method:'get',
		onLoading: fnAjaxRequestInProgress,
		onSuccess: fnProcessAjaxResponse,
		onFailure: fnAjaxRequestError		
	  });*/	
	  
	  fnAjaxRequestInProgress(contentelementid);
	  var ajaxIndex = ajaxObjects.length;
	  ajaxObjects[ajaxIndex] = new sack();
	  ajaxObjects[ajaxIndex].requestFile = url;
	  
	  ajaxObjects[ajaxIndex].onCompletion = function()
	  {
		  fnProcessAjaxResponse(ajaxObjects[ajaxIndex].response);
	  }
	  ajaxObjects[ajaxIndex].runAJAX();
 	
}

function fnProcessAjaxResponse(response)
{
	
	// var response = transport.responseText;
	var tempresponse = "";
	
	 if(tempajaxaction == "setfoldername")
	 {
		var respText1 = response.split('|');
		var	tempresponse = respText1[1];	
	 }
	
	
	 if(globalaction == "showcompanyeventtoindividual" &&(globalajaxaction == "register" || globalajaxaction == "removed"))
	 {
		 if(globalajaxaction=="register")
		 {
		 	window.location = sitename+'/'+'index.php?action=showcompanyeventtoindividual'+globalparams+'&success=You are now part of this virtual event';
		 }
		 else
		 {
			window.location = sitename+'/'+'index.php?action=showcompanyeventtoindividual'+globalparams+'&success=You have left this virtual event successfully';	 
		 }
	 }
	 else if(globalaction == "managemultimediaimages" && !tempresponse.match("Already Exists"))
	 {
		window.location = sitename+'/'+'index.php?action=managemultimediaimages&success=Folder Created successfully';	 
	 }
	 else if(globalaction == "managemultimediavideos" && !tempresponse.match("Already Exists"))
	 {
		window.location = sitename+'/'+'index.php?action=managemultimediavideos&success=Folder Created successfully';	 
	 }
	 else if(globalaction == "managemultimediapodcasts" && !tempresponse.match("Already Exists"))
	 {
		window.location = sitename+'/'+'index.php?action=managemultimediapodcasts&success=Folder Created successfully';	 
	 }
	 else if(globalaction == "managemultimediadocuments" && !tempresponse.match("Already Exists"))
	 {
		window.location = sitename+'/'+'index.php?action=managemultimediadocuments&success=Folder Created successfully';	 
	 }
	 else if((globalaction == "eventdetailsnew" || globalaction == "eventpeoplenew") && tempajaxaction == "saveeventregister")
	 {
		
		window.location = sitename+'/'+'index.php?' + response;
		response = "Record Saved";
	 }
	 else if((globalaction == "eventdetailsnew" || globalaction == "eventpeoplenew") && tempajaxaction == "setuserproject")
	 {
		
		
		window.location = sitename+'/'+'index.php?' + response;
		response = "Record Saved";
	 }
	 
	 
	 //EVEMT CONNECTOR PAGE
	 if(globalaction=="eventpeoplenew" && globalajaxaction == "login")
	 {
		try {
		document.getElementById(contentid).style.display = "none";
		}
		catch(e)
		{}
		if(response == "LOGINFAILED") alert("Enter correct login details.");
		else if(response == "LOGINSUCCESS") Lightbox.hideBox(); 
	 }
	 
	 
	 if(tempajaxaction == "setfoldername")
	 {
				  var respText = response.split('|');
					var foldervalues = document.getElementById('folderlist');
					if(respText[0] !='')
					{
						foldervalues.innerHTML = respText[0];
					}
					
					response = respText[1];	 
	 }
	
	/*if(response == false || response == "") response = "Data not available..";*/
	 
	 
	 if(tempajaxaction == "login" && response == "Successfully Login")
	 {
		 document.getElementById('id_CommentDivForTwoCents').style.display = "";
		 document.getElementById('id_LoadingDivTwoCents').style.display = "";
		 document.getElementById('id_LoadingDivTwoCents').innerHTML = "Login Successfully. Add your two cents here";
		 document.getElementById('id_LoginDivForTwoCents').style.display = "none";		
	 }
	 else  if(tempajaxaction == "login" && response != "Successfully Login")
	 {
		 document.getElementById('id_LoadingDivTwoCents').style.display = "";
		 document.getElementById('id_LoadingDivTwoCents').innerHTML = "Please Check Your Login Details.";
	 }	 
	 try{
	 document.getElementById(contentid).style.display = "";
	 document.getElementById(contentid).innerHTML = extracontent + response;
	 }
	 catch(e){}
	 
}

function fnAjaxRequestInProgress(contentelementid)
{
	try{
	document.getElementById(contentelementid).style.display = "";
	document.getElementById(contentelementid).innerHTML = "<img src='images/loading.gif' />";
	}
	catch(e){}
	
	
}

function fnAjaxRequestError(contentelementid)
{
	try{
	document.getElementById(contentelementid).style.display = "";
	document.getElementById(contentelementid).innerHTML = "Error !!!!! ";
	}
	catch(e){}
	
}
/*------------ ajax.js -------------*/

/*------------ nav.js ---------------*/
function fnShowMenus(id)
{
	document.getElementById(id).style.display = "block";

	try
	{
		document.getElementById('id_listShowRecords').style.display = "none";
		document.getElementById('id_chkSort').style.display = "none";
	}
	catch(e)
	{
		
	}
}

function fnHideMenus(id)
{
	document.getElementById(id).style.display = "none";
	
	try
	{
		//document.getElementById('id_listShowRecords').style.display = "";
		document.getElementById('id_chkSort').style.display = "";
	}
	catch(e)
	{
		
	}
}

function fnShowLoginToProfile()
{
	document.getElementById("id_gotologin").value = Base64.encode("action=myprofile");
	Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
}
/*------------ nav.js ---------------*/

/*------------ search.js ---------------*/
/**
 * Add System Message Module JS Files
 * @author Pathfinder Solutions India
 * @link http://www.pathfindersolutions.biz
 * @version 1.0
 * @package justmeans
 * @subpackage systemmessage
 */

/**
 * fnSearch function
 * @param 
 * @return search value for fuse
 */
function fnSearch(userid)
{  
	var hiddenuserid;
	var hiddencompanyid;
	var strSearchVal="";
	var strSearchKey="";
	var strAction = "";
	var strNewQuery="";
	var arrcompany="";
	var arrIndividual="";
	
	
	
	
	//hiddenuserid=hiddenuserid.split('|');
	//hiddenuserid=hiddenuserid[1];
	
	
    
	strSearchKey= document.getElementById('searchoptions').value;
	//alert(strSearchKey);
	
	
	
	if(strSearchKey=="company")
	{
		//document.getElementById('txtSearch').value="";
		//strSearchVal=document.getElementById('txtSearch').value;
		//alert(strSearchVal);
		if(strSearchVal=="" || strSearchVal == "Enter a search term..."  )
		{
			
			/////////////
			hiddencompanyidarray=document.getElementById('hidSearchCompanyId').value;
				
				if(hiddencompanyidarray!=0)
				{
					arrcompany=hiddencompanyidarray.split('|');
					if(arrcompany.length > 1)
					{
						hiddencompanyid=parseInt(arrcompany[1]);
						strSearchVal=arrcompany[0];
					}
					else
					{
						hiddencompanyid = parseInt(arrcompany[0]);
						strSearchVal= document.getElementById('autoCompanySearchList').value;
					}			
				}
				else
				{
					strSearchVal= document.getElementById('autoCompanySearchList').value;
				}
			///////////
			
		}
	}
	 
	
	if(strSearchKey=="people")
	{
		
		if(userid==0)
		{
			strSearchVal= document.getElementById('txtSearch').value;
		}
		else
		{
			//document.getElementById('txtSearch').value="";
			//strSearchVal=document.getElementById('txtSearch').value;
			if(strSearchVal=="" || strSearchVal == "Enter a search term...")
			{
				
				hiddenuseridarray=document.getElementById('hidFUserId').value;
				
				if(hiddenuseridarray!=0)
				{
					arrIndividual=hiddenuseridarray.split('|');
					
					if(arrIndividual.length > 1)
					{
						hiddenuserid=parseInt(arrIndividual[1]);
						strSearchVal=arrIndividual[0];
					}
					else
					{
						hiddenuserid = parseInt(arrIndividual[0]);
						strSearchVal= document.getElementById('autofollowinguser').value;
					}			
				}
				else
				{
					strSearchVal= document.getElementById('autofollowinguser').value;
				}
			}
			
		}
		
	}
	
	if(strSearchKey=="conversations" || strSearchKey=="peopleupdates" )
	{
		strSearchVal= document.getElementById('txtSearch').value;	
	}
	
	
	strTemp = strSearchVal.replace(/^\s+|\s+$/g,"").replace(/^\s+/,"").replace(/\s+$/,"");
	//alert(strTemp);
	if(!strTemp)
	{
		alert("Enter text to search.");
		//document.getElementById('txtSearch').value="";
		//document.getElementById('autoCompanySearchList').value="";
		//document.getElementById('autofollowinguser').value="";
		return false;
	}
	else
	{
		if(strTemp.length < 3)
			{
				alert("Enter more than 2 characters.");
				return false;
			}
	}
	
	if (strSearchKey && strSearchVal && strSearchVal != "Enter a search term..." ) 
	{
		if(strSearchKey=="people" || strSearchKey=="company")
		{
			if(strSearchVal.length < 3)
			{
				alert("Enter more than 2 characters.");
				return false;
			}
		}
		/*var strReplace = "and";
		var intSearchResult = strSearchVal.search("&"); 
		if(intSearchResult != -1){ 
			 strNewQuery = strSearchVal.replace(/&/g, strReplace);
		}
		else{*/
		//alert(strSearchVal);
		//alert(strSearchVal);
		strSearchVal=escape(strSearchVal);
		//strSearchVal=encodeURI(strSearchVal);
		//alert(strSearchVal);
			strNewQuery=strSearchVal;
		//}  
		document.getElementById('id_newhidque').value = strSearchVal; 
		
		switch (strSearchKey)
		{
			
			case "people":
				if(hiddenuserid)
					strAction = mainsitename+"index.php?action=searchpeople&que="+strNewQuery+"&id="+hiddenuserid;
				else
					strAction = mainsitename+"index.php?action=searchpeople&que="+strNewQuery;
				
			break;
			case "company":	
			if(hiddencompanyid)
				strAction = mainsitename+"index.php?action=searchcompanies&que="+strNewQuery+"&id="+hiddencompanyid; 
				
			else
				strAction = mainsitename+"index.php?action=searchcompanies&que="+strNewQuery; 
							break;
			case "content":	strAction = mainsitename+"index.php?action=searchcontent&que="+strNewQuery;
							break;
			case "peopleupdates":strAction = mainsitename+"index.php?action=showallwruwo&que="+strNewQuery+"&s=u";
							break;
			case "conversations":strAction = mainsitename+"index.php?action=showallwruwo&que="+strNewQuery+"&s=c";
							break;				
		}
		//alert(strAction);
		//return false;
		document.frmTopSearch.action = strAction;
		document.frmTopSearch.submit();
		hiddencompanyid="";
		return true;
	}
	else
	{
		alert("Enter text to search.");
		return false;
	}
}



function fnJobSearch()
{
	
	var strSearchVal = document.getElementById('id_keywords').value;
	
	var strAction = "";
	if (strSearchVal && strSearchVal != "Enter Keyword...")
	{
		/*if(strSearchVal.length==1)
		{
			
			ajax_showTooltip('id_ErrorMessagjobSearchDivSingle',document.getElementById("id_keywords"),240,55);
			return false;	
		}*/
		//document.frmJobSearch.action = sitename+'/'+"index.php?action=searchresult&sub_searchjobs=Jobsearch&txt_keywords="+strSearchVal;
		//jobsearch&issearched=1&action=jobsearch&country_lookupCity=&regioncity=&lookupCity=&bntJobSearch.x=42&bntJobSearch.y=29&visited=1#results
		document.frmJobSearch.action = sitename+'/'+"index.php?action=jobsearch&issearched=1&txt_keywords="+strSearchVal+"#results";		
		document.frmJobSearch.submit();
		return true;
	}
	else
	{
		ajax_showTooltip('id_ErrorMessageJobSearchDiv',document.getElementById("id_keywords"),200,55);
			return false;
		
	}
}

function replaceAll(text, strA, strB)
{
    while ( text.indexOf(strA) != -1)
    {
        text = text.replace(strA,strB);
    }
    return text;
}

function fnEventSearch()
{ 
	var strSearchVal = document.getElementById('id_eventkeywords').value;
	var strAction = "";
	if (strSearchVal && strSearchVal != "Enter Keyword...")
	{
		/*if(strSearchVal.length==1)
		{
			ajax_showTooltip('id_ErrorMessageeventSearchDivSingle',document.getElementById("id_eventkeywords"),240,55);
			return false;	
		}*/
		strSearchVal = replaceAll(strSearchVal," ","+");
		document.frmEventSearch.action = sitename+'/'+"index.php?action=listeventnew&txt_keywords="+strSearchVal;		
		document.frmEventSearch.submit();
		return true;
	}
	else
	{
		ajax_showTooltip('id_ErrorMessageeventSearchDiv',document.getElementById("id_eventkeywords"),200,55);
			return false;
	}
}

function fnWRUWOPplSearch()
{
	
	var strSearchVal = document.getElementById('id_pplkeywords').value;	
		//var strUpdateSearchVal = document.getElementById('id_srchUpdates').value;
	var strAction = "";
	if(strSearchVal && strSearchVal != "Enter Keyword...") 
	{
		if(strSearchVal.length==1) 
		{
			alert(" Please enter text more than one character to search.");
			return false;			
		}
		document.frmUserSearch.action = sitename+'/'+"index.php?action=searchpeople&que="+strSearchVal;		
		document.frmUserSearch.submit();
		return true;		
		
	}
	else
	{
		alert ("Please enter text for search")
		return false;
	}
}

function fnWRUWOUpdateSearch()
{
	
	var strUpdateSearchVal = document.getElementById('id_srchUpdates').value;	
	var strAction = "";
	if (strUpdateSearchVal && strUpdateSearchVal != "Enter Keyword...")
	{
		if(strUpdateSearchVal.length==1) 
		{
			alert(" Please enter text more than one character to search.");
			return false;			
		}
		
			document.frmUserSearchUpdates.action = sitename+'/'+"index.php?action=showallwruwo&que="+strUpdateSearchVal;
			document.frmUserSearchUpdates.submit();
			return true;
	}
	else
	{
		alert ("Please enter text for search")
		return false;
	}
}

function fnWRUWOUpdateTopicSearch()
{
	
	var strSearchVal = document.getElementById('id_pplkeywords').value;	
		//var strUpdateSearchVal = document.getElementById('id_srchUpdates').value;
	var strAction = "";
	if(strSearchVal && strSearchVal != "Enter Keyword...") 
	{		
		document.frmUserSearch.action = sitename+'/'+"index.php?action=showallwruwo&s=u&que="+strSearchVal;		
		document.frmUserSearch.submit();
		return true;		
	}
	else
	{
		alert ("Please enter text for search")
		return false;
	}
}

function fnWRUWOUpdateConversationSearch()
{
	
	var strSearchVal = document.getElementById('id_convkeywords').value;	
		//var strUpdateSearchVal = document.getElementById('id_srchUpdates').value;
	var strAction = "";
	if(strSearchVal && strSearchVal != "Enter Keyword...") 
	{		
		document.frmUserConvSearch.action = sitename+'/'+"index.php?action=showallwruwo&s=c&que="+strSearchVal;		
		document.frmUserConvSearch.submit();
		return true;		
	}
	else
	{
		alert ("Please enter text for search")
		return false;
	}
}


    function fnValidateNewsSearchRight()
	{
	    
		var strErrorMessage = "";
        if(document.getElementById('companyid').value=="")
		{
			strErrorMessage = " Please enter Company Name.";
			 
		}
		if(strErrorMessage=="")
		{
			return true;
		}
		else
		{	
		   alert(strErrorMessage);
		   return false;
		}
		
	 }
	 
	 
	 function fnUpdatesearch()
	{
	
		var strSearchVal = document.getElementById('id_searchkeyword').value;
		var strSearchTypeVal = document.getElementById('id_hidSearchType').value;
			
		var strAction = "";
		if(strSearchVal && strSearchVal != "Enter Keyword...") 
		{
			/*if(strSearchVal.length==1) 
			{
				alert(" Please enter text more than one character to search.");
				return false;			
			}*/
			document.frmUpdatesSearch.action = sitename+'/'+"index.php?action=showallwruwo&que="+strSearchVal+"&s="+strSearchTypeVal;		
			document.frmUpdatesSearch.submit();
			return true;		
			
		}
		else
		{
			alert ("Please enter text for search")
			return false;
		}
	}
	
	function fnUpdateSearchFor()
	{	
		var strSearchVal = document.getElementById('id_searchkeywordfor').value;
		var strSearchActionVal = document.getElementById('id_hidSearchFor').value;
			
		var strAction = "";
		if(strSearchVal && strSearchVal != "Enter Keyword...") 
		{
			
			/*var strReplace = "and";
			var intSearchResult = strSearchVal.search("&");
			if(intSearchResult != -1){
				var strNewQuery = strSearchVal.replace(/&/g, strReplace);
			}
			else{*/
			
			strTemp = strSearchVal.replace(/^\s+|\s+$/g,"").replace(/^\s+/,"").replace(/\s+$/,"");
			
			if(!strTemp)
			{
				alert("Enter text to search.");
				document.getElementById('id_searchkeywordfor').value="";
				return false;
			}
			else
			{
				if(strTemp.length < 3)
				{
					alert("Enter more than 2 characters.");
					return false;
				}
			}
			strSearchVal=escape(strSearchVal);
			strNewQuery=strSearchVal;
			
			
			
				
			//}
			document.getElementById('id_newhidque').value = strSearchVal;
			strFrmAction = sitename+'/'+"index.php?action="+strSearchActionVal+"&que="+strNewQuery;
			document.frmSearchFor.action = strFrmAction;
			//document.frmSearchFor.action = sitename+'/'+strSearchActionVal+"&que="+strSearchVal;
			document.frmSearchFor.submit();
			return true;		
		}
		else
		{
			alert ("Enter text for search")
			return false;
		}
	}


/**
 * fnChangeSearchBox function
 * @param 
 * @return search value for fuse
 */
	
	function fnChangeSearchBox(userid)
	{
		
		document.getElementById('id_distxtsearch').style.display = 'none';
		document.getElementById('id_discompanysearch').style.display = 'none';
		document.getElementById('id_disusersearch').style.display = 'none';
		
	
		var strSearchKey;
		strSearchKey = document.getElementById('searchoptions').value;
		
		if(strSearchKey=="company")
		{
			document.getElementById('id_distxtsearch').style.display = 'none';
			document.getElementById('id_disusersearch').style.display = 'none';
			document.getElementById('id_discompanysearch').style.display = 'block';

		}
		else if(strSearchKey=="people")
		{
			if(userid==0)
			{
				
				document.getElementById('id_distxtsearch').style.display ='block';
				document.getElementById('id_discompanysearch').style.display='none';
				document.getElementById('id_disusersearch').style.display = 'none';
			}
			else
			{
				document.getElementById('id_distxtsearch').style.display = 'none';
				document.getElementById('id_discompanysearch').style.display = 'none';
				document.getElementById('id_disusersearch').style.display = 'block';
			}
		}
		else
		{
			document.getElementById('id_distxtsearch').style.display ='block';
			document.getElementById('id_discompanysearch').style.display='none';
			document.getElementById('id_disusersearch').style.display = 'none';
		}
	 
		return false;
	
	}
	
	
	
	function fnSearchRedirect(type,searchword,id)
	{
		var url;
		var strAction;
		//alert(document.getElementById('autofollowinguser').value);
		document.getElementById('autofollowinguser').value="";
		document.getElementById('hidFUserId').value="";
		
		
			

		if(type=='p')
		{
			if(id)
			{
				strAction = mainsitename+"myprofile?user="+id; 
			}
			else
			{
				strAction = mainsitename+"index.php?action=searchpeople&que="+searchword;
			}
			
			
		}
		else
		{
			if(id)
			{
				strAction = mainsitename+"index.php?action=viewcompanyprofile&id="+id; 
			}
			else
			{
				strAction = strAction = mainsitename+"index.php?action=searchcompanies&que="+searchword; 
			}
		}
		location.href=strAction;
		
		
	}
	
	function fnSearchRedirectToUrl(url)
	{
		location.href=url;
	}	
/*------------ search.js ---------------*/

/*------------ mf_lightbox.js ---------------*/
/*
	Multifaceted Lightbox
	by Greg Neustaetter - http://www.gregphoto.net
	
	INSPIRED BY (AND CODE TAKEN FROM)
	==================================
	The Lightbox Effect without Lightbox
	PJ Hyett
	http://pjhyett.com/articles/2006/02/09/the-lightbox-effect-without-lightbox
	

	Lightbox JS: Fullsize Image Overlays 
	by Lokesh Dhakar - http://www.huddletogether.com

	For more information on this script, visit:
	http://huddletogether.com/projects/lightbox/

	Licensend under:
	Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
	(basically, do anything you want, just leave my name and link)
	
*/

var ajaxObjects = new Array();
var isNext = 0;
var intTop = 0;
var intHeight = 0;
var Lightbox = { 
	lightboxType : null,
	lightboxCurrentContentID : null,
	refreshAfterClose : 0,
	
	showBoxString : function(content, boxWidth, boxHeight){
		this.setLightboxDimensions(boxWidth, boxHeight);
		this.lightboxType = 'string';
		var contents = document.getElementById('boxContents');
		contents.innerHTML = content;
		this.showBox();
		return false;
	},


	showBoxImage : function(href) {
		this.lightboxType = 'image';
		var contents = document.getElementById('boxContents');
		var objImage = document.createElement("img");
		objImage.setAttribute('id','lightboxImage');
		contents.appendChild(objImage);
		imgPreload = new Image();
		imgPreload.onload=function(){
			objImage.src = href;
			Lightbox.showBox();
		}
		imgPreload.src = href;
		return false;
	},

	showBoxByID : function(id, boxWidth, boxHeight) {
		this.lightboxType = 'id';
		this.lightboxCurrentContentID = id;
		this.setLightboxDimensions(boxWidth, boxHeight);
		var element = document.getElementById(id);
		document.getElementById('boxContents').innerHTML='';
		var contents = document.getElementById('boxContents');
		contents.appendChild(element);
		//Element.show(id); 
		document.getElementById(id).style.display = 'block';
		
		this.showBox();
		return false;
	},

	showBoxByAJAX : function(href, boxWidth, boxHeight) {
		this.lightboxType = 'ajax';
		this.setLightboxDimensions(boxWidth, boxHeight);
		var contents = document.getElementById('boxContents');
		//var myAjax = new Ajax.Updater(contents, href, {method: 'get'});
			
			var ajaxIndex = ajaxObjects.length;	
	ajaxObjects[ajaxIndex] = new sack();
				//var strUrl = sitename+"/index.php?action=blockuseripajax&mode=ajax&ajax_action=ajaxblock&bt="+strspamflag+"&aid="+intActId;
				var strUrl = href;				
				ajaxObjects[ajaxIndex].requestFile = strUrl;
				ajaxObjects[ajaxIndex].onCompletion = function()
														{ 
															 var lookup = (ajaxObjects[ajaxIndex].response);
															 contents.innerHTML = lookup;
														};									
				ajaxObjects[ajaxIndex].runAJAX();
		
		
		this.showBox();
		return false;
	},
	
	setLightboxDimensions : function(width, height) {
		var windowSize = this.getPageDimensions();
		if(width) {
			if(width < windowSize[0]) {
				document.getElementById('box').style.width = width + 'px';
			} else {
				document.getElementById('box').style.width = (windowSize[0] - 50) + 'px';
			}
		}
		if(height) {
			if(height < windowSize[1]) {
				document.getElementById('box').style.height = height + 'px';
			} else {
				document.getElementById('box').style.height = (windowSize[1] - 50) + 'px';
			}
		}
	},


	showBox : function() {
		//Element.show('overlay');
		document.getElementById("overlay").style.display='block';
		this.center('box');
		return false;
	},
	
	
	hideBox : function(){
		
		if(this.refreshAfterClose==1 || isNext)
		{
			isNext = 0;
			window.location.reload( true );	
		}
		else
		{
			var ajaxObjects = new Array();
			var contents = $('boxContents');
			var ajaxIndex = ajaxObjects.length;	
			ajaxObjects[ajaxIndex] = new sack();
			ajaxObjects[ajaxIndex].requestFile = sitename+"/index.php?action=setunsetsessionvars&mode=ajax&ajax_action=resetsessionparams";
			ajaxObjects[ajaxIndex].onCompletion = function(){
																
															};	// Specify function that will be executed after file has been found
			ajaxObjects[ajaxIndex].runAJAX();
			
			var contents = document.getElementById('boxContents');
			if(this.lightboxType == 'id') {
				var body = document.getElementsByTagName("body").item(0);
	
				//Element.hide(this.lightboxCurrentContentID);
				document.getElementById(this.lightboxCurrentContentID).style.display='none';
				body.appendChild(document.getElementById(this.lightboxCurrentContentID));
			}
			try
			{
				document.getElementById("ajax_listOfOptions").style.display="none";
				document.getElementById("ajax_listOfOptions_iframe").style.display="none";
				
			}
			catch(err)
			{
				//
			}
			contents.innerHTML = '';
			document.getElementById('boxContents').innerHTML = '';
			document.getElementById('box').style.width = null;
			document.getElementById('box').style.height = null;
			//Element.hide('box');
			document.getElementById('box').style.display='none';
			//Element.hide('overlay');
			document.getElementById('overlay').style.display='none';
			return false;
		}
	},
	
	hideParentBox : function(){
		if(this.refreshAfterClose==1 || isNext )
		{
			isNext = 0;
			parent.window.location.reload( true );	
		}
		else
		{
			var ajaxObjects = new Array();
			//var contents = parent.document.getElementById('boxContents');
			if(this.lightboxType == 'id')
			{
				var body = document.getElementsByTagName("body").item(0);
				try{
				document.getElementById(this.lightboxCurrentContentID).style.display='none';
				body.appendChild(document.getElementById(this.lightboxCurrentContentID));
				}
				catch(e)
				{
					parent.document.getElementById(this.lightboxCurrentContentID).style.display='none';
				}
			}
			
			parent.document.getElementById('box').style.width = null;
			parent.document.getElementById('box').style.height = null;
			parent.document.getElementById('box').style.display='none';
			parent.document.getElementById('overlay').style.display='none';
			//parent.document.getElementById('boxContents').innerHTML = null;
			return false;
		}
	},
	
	// taken from lightbox js, modified argument return order
	getPageDimensions : function(){
		var xScroll, yScroll;
	
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		var windowWidth, windowHeight;
		if (self.innerHeight) {	// all except Explorer
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		
		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}
	
		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){	
			pageWidth = windowWidth;
		} else {
			pageWidth = xScroll;
		}
		arrayPageSize = new Array(windowWidth,windowHeight,pageWidth,pageHeight) 
		return arrayPageSize;
	},
	
	center : function(element){
		try{
			element = document.getElementById(element);
		}catch(e){
			return;
		}
		var windowSize = this.getPageDimensions();
		var window_width  = windowSize[0];
		var window_height = windowSize[1];
		
		document.getElementById('overlay').style.height = windowSize[3] + 'px';
		
		element.style.position = 'absolute';
		element.style.zIndex   = 10000;
	
		var scrollY = 0;
	
		if ( document.documentElement && document.documentElement.scrollTop ){
			scrollY = document.documentElement.scrollTop;
		}else if ( document.body && document.body.scrollTop ){
			scrollY = document.body.scrollTop;
		}else if ( window.pageYOffset ){
			scrollY = window.pageYOffset;
		}else if ( window.scrollY ){
			scrollY = window.scrollY;
		}
	
		var elementDimensions = this.getDimensionsLightBox(element);
		var setX = ( window_width  - elementDimensions.width  ) / 2;
		var setY = ( window_height - elementDimensions.height ) / 2 + scrollY;
	
		setX = ( setX < 0 ) ? 0 : setX;
		setY = ( setY < 0 ) ? 0 : setY;
	
		element.style.left = setX + "px";		
		element.style.top  = setY + "px"; // comment this line and uncomment fnSetTop if u want top animation;
		
		//element.style.overflow = 'hidden';
		//fnSetTop(element.id,setY); // VIKRANT CHANGE
		//fnSetHeight(element.id,parseInt(element.style.height)); // VIKRANT CHANGE
		
		element.style.display=''
	},
	
	getDimensionsLightBox: function(element) {
	
   if (element.style.display != 'none')
      return {width: element.offsetWidth, height: element.offsetHeight};

    // All *Width and *Height properties give 0 on elements with display none,
    // so enable the element temporarily
    var els = element.style;
    var originalVisibility = els.visibility;
    var originalPosition = els.position;
    els.visibility = 'hidden';
    els.position = 'absolute';
    els.display = '';
    var originalWidth = element.clientWidth;
    var originalHeight = element.clientHeight;
    els.display = 'none';
    els.position = originalPosition;
    els.visibility = originalVisibility;
    return {width: originalWidth, height: originalHeight};
  },

	
	
	init : function() {				  
		var lightboxtext = '<div id="overlay" style="display:none"></div>';
		lightboxtext += '<div id="box" style="display:none">';
		lightboxtext += '<img id="close" src="images/close.gif" onClick="Lightbox.hideBox()" alt="Close" title="Close this window" />';
		lightboxtext += '<div id="boxContents"></div>';
		lightboxtext += '</div>';
		var body = document.getElementsByTagName("body").item(0);
		new Insertion.Bottom(body, lightboxtext);
	}
}


function fnSetTop (id,top)
{
   if(intTop <= top)
	{
		intTop = intTop + 20;
		document.getElementById(id).style.top = intTop + "px";
		var fnTop = setTimeout("fnSetTop('"+id+"',"+top+")", 1);
	}
	else
	{
		intTop = 0;
		clearTimeout(fnTop);
	}		
}


function fnSetHeight(id,height)
{
	if(intHeight <= height)
	{
		intHeight = intHeight + 40;
		document.getElementById(id).style.height = intHeight + "px";
		var fnHeight = setTimeout("fnSetHeight('"+id+"',"+height+")", 1);
	}
	else
	{
		intHeight = 0;	
		document.getElementById(id).style.overflow = 'auto';
		clearTimeout(fnHeight);
	}
}


function init() {
			Lightbox.init();
		}
		
/*Event.observe(window, 'load', init, false); 
		function init() {
			Lightbox.init();
		}*/
/*------------ mf_lightbox.js ---------------*/

/*------------ email.js ---------------*/
// JavaScript Document
function fnEmailCheck (emailStr) {
var emailPat=/^(.+)@(.+)$/

var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"

var validChars="\[^\\s" + specialChars + "\]"

var quotedUser="(\"[^\"]*\")"

var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/

var atom=validChars + '+'

var word="(" + atom + "|" + quotedUser + ")"

var userPat=new RegExp("^" + word + "(\\." + word + ")*$")

var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")


var matchArray=emailStr.match(emailPat)
if (matchArray==null) 
 {
 alert("Email address seems incorrect (check @ and .'s)")
 return false
 }
var user=matchArray[1]
var domain=matchArray[2]

// See if "user" is valid
if (user.match(userPat)==null) {
    // user is not valid
    alert("The username doesn't seem to be valid.")
    return false
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
   host name) make sure the IP address is valid. */
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
    // this is an IP address
   for (var i=1;i<=4;i++) {
     if (IPArray[i]>255) {
         alert("Destination IP address is invalid!")
  return false
     }
    }
    return true
}

// Domain is symbolic name
var domainArray=domain.match(domainPat)
if (domainArray==null) {
 alert("The domain name doesn't seem to be valid.")
    return false
}

var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 ||
    domArr[domArr.length-1].length>4) {
   // the address must end in a two letter or three letter word.
   alert("The address must end in a three-letter domain, or two letter country.")
   return false
}

// Make sure there's a host name preceding the domain.
if (len<2) {
   var errStr="This address is missing a hostname!"
   alert(errStr)
   return false
}



// If we've got this far, everything's valid!
return true;
}

function fnValidateString(alphane)
{
	var numaric = alphane;
	for(var j=0; j<numaric.length; j++)
		{
		  var alphaa = numaric.charAt(j);
		  var hh = alphaa.charCodeAt(0);
		  //if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123))
		  if((hh > 64 && hh<91) || (hh > 96 && hh<123) || (alphaa==' ') || (alphaa=='-') || (alphaa=="'"))
		  {
		  }
		else
		  {
			 return false;
		  }
		}
 return true;
}

function fnValidateCompanyTags(string)
{
	var strLen = string.length
	var iChars = "*|,\":<>[]{}`\';()@&$%";
	for (var i = 0; i < strLen; i++) 
	{
		if (iChars.indexOf(strLen.charAt(i)) != -1)
		return false;
	}
	return true;
}

function fnIsNumber(intNumber)
{
	if(isNaN(intNumber) == true)	
	{
		alert("Please enter only digits!");
		return false;
	}
	else
	{
		return true;
	}
}
//  End -->
/*------------ email.js ---------------*/

/*------------ userhomepageV6.js ---------------*/
/**
 * Home Module JS Files
 * @author Pathfinder Solutions India
 * @link http://www.pathfindersolutions.biz
 * @version 1.0
 * @package justmeans
 * @subpackage home 
 */
 var ajaxObjects = new Array();
 function fnCheckCharCntWOSpaces()
	{
		var strText;
		var origlength;

		strText = document.getElementById('id_txtWhatAreUWorking').value;
		// \s Matches any white-space character.
		// \s is equivalent to [ \f\n\r\t\v].
		// removes white spaces \n etc

		strTempText = strText.replace(/\s+/g,'');
		if(140 - strTempText.length >= 0)
		{
			origlength = strText.length;
			document.getElementById('id_chartextcnt').innerHTML = 140 - strTempText.length;
		}
		else
		{
			document.getElementById('id_txtWhatAreUWorking').value = strText.substring(0, origlength);
			if(document.getElementById('id_txtWhatAreUWorking').value == "")
			{
				remainngcnt = strText.length - strTempText.length;
				
				origlength = 140 + remainngcnt;
				document.getElementById('id_chartextcnt').innerHTML = 0;				
				document.getElementById('id_txtWhatAreUWorking').value = strText.substring(0, origlength);
			}
		}
		
	}


	function fnCheckCharCnt()
	{ 

		var strText;
		var strTextLen;		
		//document.getElementById("id_txtWhatAreUWorking").style.class = "inputfont";
		strText = document.getElementById("id_txtWhatAreUWorking").value;
		if(strText == "Enter update here...") strText = "";
		// \s Matches any white-space character.
		// \s is equivalent to [ \f\n\r\t\v].
		// removes white spaces \n etc
		/*if(140 - strText.length > 0)
		{
			document.getElementById('id_chartextcnt').innerHTML = 140 - strText.length;
		}
		else
		{*/	 		
			if(140 - strText.length >= 20)
			{
				
				//document.getElementById('id_chartextcnt').innerHTML = 140 - strText.length;
				document.getElementById('id_chartextcnt').className = "charcount";
			}
			else if((140 - strText.length < 20) &&  (140 - strText.length > 10) )
			{					
				document.getElementById('id_chartextcnt').className = "charcount20";
			}
			else
			{
				document.getElementById('id_chartextcnt').className = "charcountnegative";
			}
			
			if(140 - strText.length  < 0)
			{
				//document.getElementById('btnEnter').src = "images/btn_enterdisable.gif";
				document.getElementById('btnEnter').src = "images/btn_gwUpdateDisable.gif";
			}
			else
			{
				//document.getElementById('btnEnter').src = "images/btn_update.gif";
				document.getElementById('btnEnter').src = "images/btn_gwUpdate.gif";
			}

			if((140 - strText.length <= 139) && (140 - strText.length > -1)){ 
				try{
			  		ajax_hideTooltip();
				}
				catch(e){}
			}
			document.getElementById('id_chartextcnt').innerHTML =140 - strText.length;
	}
	
	/*Function added by mayur since the function name was same in allcomment.js and was not working on Events left panel */
	function fnEventCheckCharCnt()
	{
		var strText;
		
		strText = document.getElementById("id_txtEventWhatAreUWorking").value;
		
		if(140 - strText.length >= 20)
			{
				
				//document.getElementById('id_chartextcnt').innerHTML = 140 - strText.length;
				document.getElementById('id_chartextcnt').className = "charcount";
			}
			else if((140 - strText.length < 20) &&  (140 - strText.length > 10) )
			{					
				document.getElementById('id_chartextcnt').className = "charcount20";
			}
			else
			{
				document.getElementById('id_chartextcnt').className = "charcountnegative";
			}
			
			if(140 - strText.length  < 0)
			{
				document.getElementById('btnEnter').src = "images/btn_enterdisable.gif";
			}
			else
			{
				document.getElementById('btnEnter').src = "images/btn_enter.gif";
			}
			
			
			if((140 - strText.length <= 139) && (140 - strText.length > -1)){ 
				try{
			  		ajax_hideTooltip();
				}
				catch(e){}
			}
			
			
			document.getElementById('id_chartextcnt').innerHTML =140 - strText.length;
			
			
		
		// \s Matches any white-space character.
		// \s is equivalent to [ \f\n\r\t\v].
		// removes white spaces \n etc
		/*if(140 - strText.length > 0)
		{
			document.getElementById('id_chartextcnt').innerHTML = 140 - strText.length;
		}
		else
		{
			
			if(140 - strText.length > 0)
			{
				document.getElementById('id_chartextcnt').innerHTML = 140 - strText.length;
			}
			else
			{
				document.getElementById('id_chartextcnt').innerHTML = 0;
			}	
			document.getElementById("id_txtEventWhatAreUWorking").value = strText.substring(0, 140);
		/*}*/
		
	}

	function fnValidateInputForWAU(loginuserid, straction, txtRecId, eventid, approveflag) //approveflag required for Events Comment 8 april 2009 Chaitanya
	{ 
		var strText;
		var strExtraparam;
		
		if(txtRecId == "" || txtRecId == 0)
		{
			if(eventid)
			{
				strText = document.getElementById('id_txtEventWhatAreUWorking').value;
			}
			else
			{
				strText = document.getElementById('id_txtWhatAreUWorking').value;
			}
		
			strExtraparam = "";
		}
		else
		{
			if(eventid)
			{
				strText = document.getElementById('id_txtEventWhatAreUWorking').value;
				strExtraparam = "&parentid="+txtRecId+"&id="+eventid;
			}
			else
			{
				strText = document.getElementById('id_txtWhatAreUWorking_'+txtRecId).value;
				strExtraparam = "&parentid="+txtRecId;
			}
			
			
		}		
		
		if(strText == "" || strText =="Enter update here...")
		{
			ajax_showTooltip('id_ErrorMessageDiv',document.getElementById("btnEnter"),250,50);
			//alert("Enter Text For 'What good work are you doing right now?' ");
			return false;
		}
		else if(140 - strText.length  < 0)
		{
			
			ajax_showTooltip('id_ErrorMessageExceedDiv',document.getElementById("btnEnter"),280,50);
			return false;
		}
		else
		{	 
			// FOR LOADER IMAGE DIV
			if (parseInt(txtRecId) > 0)
				fnShowDefauleLoaderImage("id_GoodworkEnter_"+txtRecId,"id_GoodworkLoader_"+txtRecId);
			else
				fnShowDefauleLoaderImage("id_GoodworkEnter","id_GoodworkLoader");
		
			strText = strText.substring(0, 140);
	 		//strText = strText.replace(/\r?\n/g,'<br/>');
			strText = Base64.encode(strText);
			
			if (straction == "" || straction == "userhomepagev6")
				straction = "userhomepagev6?isnewu=1";
			
			ajaxObjects[0] = new sack();
			ajaxObjects[0].requestFile = sitename+"/index.php?action=setunsetsessionvars&mode=ajax&ajax_action=setsessionparams&settoparams=forwgwrud&location="+straction+"&txtWhatAreUWorking="+strText+"&parentid="+txtRecId+"&eventid="+eventid+"&approveflag="+approveflag;
			ajaxObjects[0].onCompletion = function(){  
																if(loginuserid == 0 || loginuserid == "")
																{
																		// FOR LOADER IMAGE DIV
																		if (parseInt(txtRecId) > 0)
																			fnHideDefauleLoaderImage("id_GoodworkEnter_"+txtRecId,"id_GoodworkLoader_"+txtRecId);
																		else
																			fnHideDefauleLoaderImage("id_GoodworkEnter","id_GoodworkLoader");
																		
																		//Lightbox.showBoxByID('divRegisterLogin', 570,345);
																		Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
																		return false;
																}
																else
																{																	
																	ajaxObjects[1] = new sack();
																	ajaxObjects[1].requestFile = sitename+"/index.php?action=checkuseractype";
																	ajaxObjects[1].onCompletion = function(){
																												if (ajaxObjects[1].response == 1)
																												{
																													fnProcessAjaxCode(10);
																												}
																												else if (ajaxObjects[1].response == 2)
																												{
																													// FOR LOADER IMAGE DIV
																													if (parseInt(txtRecId) > 0)
																														fnHideDefauleLoaderImage("id_GoodworkEnter_"+txtRecId,"id_GoodworkLoader_"+txtRecId);
																													else
																														fnHideDefauleLoaderImage("id_GoodworkEnter","id_GoodworkLoader");
																			
																													//Lightbox.showBoxByID('divRegisterLogin', 570,345);
																													Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
																													fnProcessAjaxCode(10);
																													document.getElementById('divRegisterLogin').innerHTML = "";
																													try
																													{
																														if (document.getElementById("id_hdnUserUpdates").value == "close" && document.getElementById('divRegisterLogin').style.display == "none")
																															fnShowPrivacyMessage();	
																													}
																													catch(e){}
																												}
																												else
																												{
																													//alert("You do not have permission to add \"What good work are you doing right now?\"");
																													return false;
																												}
																											}
																	ajaxObjects[1].runAJAX();
																}
															};	// Specify function that will be executed after file has been found
			ajaxObjects[0].runAJAX();
		}
		return true;
	}
	
	function fnSendConnectRequest(loginuserid,recieverid,recid)
	{
		
		if(recieverid != "" || recieverid != 0)
		{
			//fnAjaxCaller("", "setunsetsessionvars", "setsessionparams", "&settoparams=forconnectuser&connectrecieverid="+recieverid,"","");
			//setTimeout("",1000);
			var ajaxIndex = ajaxObjects.length;	
			ajaxObjects[ajaxIndex] = new sack();
			ajaxObjects[ajaxIndex].requestFile = sitename+"/index.php?action=setunsetsessionvars&mode=ajax&ajax_action=setsessionparams&settoparams=forconnectuser&connectrecieverid="+recieverid;
			ajaxObjects[ajaxIndex].onCompletion = function(){ 
			
																if(loginuserid == 0 || loginuserid == "")
																{
																	//Lightbox.showBoxByID('divRegisterLogin', 570,345);
																	Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
																	//return false;
																}
																else
																{
																	if(loginuserid == recieverid)
																	{
																		document.getElementById("relationsipdiv_" + recid).style.display="";
																		document.getElementById("relationsipdiv_" + recid).innerHTML="<br /><b><font color='#FF0000'>Sorry, you can not connect with yourself</font></b>"; 
																	}
																	else
																	{
																		fnAjaxCaller("relationsipdiv_" + recid,"sendconnecttouser","","&isbyajax=1","","");
																		document.getElementById("relationsipdiv_" + recid).style.display="none";
																	}
																}
																
															};	// Specify function that will be executed after file has been found
			ajaxObjects[ajaxIndex].runAJAX();
			
			
		}
		
	}
	
	
	function fnToggleImageForReplyConnect(intRec,suserid,loginuserid)
	{
		
			/*var strFileSource = document.getElementById('imageid_' + intRec).src; 
			var temp = strFileSource.split('/');*/
			
			/*if(temp[temp.length - 1] == "arrowside.gif")*/
			if(document.getElementById("relationsipdiv_" + intRec).style.display=="none")
			{
				/*document.getElementById('imageid_'+intRec).src= "images/arrowdown.gif"; */
				if(suserid == loginuserid)
				{
					document.getElementById("relationsipdiv_" + intRec).style.display="";
					document.getElementById("relationsipdiv_" + intRec).innerHTML="<br /><b><font color='#FF0000'>Sorry, you can not send a private message to yourself.</font></b>"; 
				}
				else
				{
					//issetfocus
					document.getElementById('issetfocus').value = "msg_"+intRec;
					fnAjaxCaller("relationsipdiv_" + intRec,"userhomepageV6","showreplytoconnect","&recid=" + intRec + "&suserid=" + suserid,"","");
				}
			}
			else
			{
				/*document.getElementById('imageid_' + intRec).src= "images/arrowside.gif"; */
				document.getElementById("relationsipdiv_" + intRec).innerHTML=""; 
				document.getElementById("relationsipdiv_" + intRec).style.display="none";
			}		
	}
	
	function fnProcessReplyToConnect(loginuserid,recid,uid)
	{
			strSubject = document.getElementById('sub_'+recid).value;
			strMessage = document.getElementById('msg_'+recid).value;
			
			strMessage = escape(strMessage);
			strMessage = strMessage.replace(/\r?\n/g,'<br/>');
			
			strSubject = escape(strSubject);
			
			if(strSubject == "" || strMessage == "")
			{
				alert("Please Enter Subject and Message to send");
			}
			else
			{
				//fnAjaxCaller("", "setunsetsessionvars", "setsessionparams", "&settoparams=forreplytoconnect&suserid="+uid+"&replyconnectsubject="+strSubject+"&replyconnectmessage="+strMessage,"","");
				//setTimeout("",1000);
				
				var ajaxIndex = ajaxObjects.length;	
				ajaxObjects[ajaxIndex] = new sack();
				ajaxObjects[ajaxIndex].requestFile = sitename+"/index.php?action=setunsetsessionvars&mode=ajax&ajax_action=setsessionparams&settoparams=forreplytoconnect&suserid="+uid+"&replyconnectsubject="+strSubject+"&replyconnectmessage="+strMessage;
				ajaxObjects[ajaxIndex].onCompletion = function(){
																	if(loginuserid == 0 || loginuserid == "")
																	{
																		Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
																	}
																	else
																	{
																		fnAjaxCaller("relationsipdiv_" + recid,"addreplytoconnect","","&recid=" + recid + "&isbyajax=1","","");
																		document.getElementById("relationsipdiv_" + recid).style.display="none";
																	}
																};	// Specify function that will be executed after file has been found
				ajaxObjects[ajaxIndex].runAJAX();
				
				
			}
	}

	function fnSetReplyUserName(strUserName)
	{
		if(strUserName != "")
		{
			
			document.getElementById('id_txtWhatAreUWorking').value = "@"+strUserName+ " " ;
			var strText = document.getElementById('id_txtWhatAreUWorking').value;
			document.getElementById('id_chartextcnt').innerHTML = 140 - (strText.length);
		}
		
		document.getElementById('id_txtWhatAreUWorking').focus();
	}
	

	var ajaxObjects = new Array();
	
	function fnReplyToComment(intRec,suserid,loginuserid,statusid,straction)
	{
		
			/*var strFileSource = document.getElementById('imageid_' + intRec).src; 
			var temp = strFileSource.split('/');*/
			/*if(temp[temp.length - 1] == "arrowside.gif")*/
			
			/*if(loginuserid == 0 || loginuserid == "")
			{
				Lightbox.showBoxByID('divRegisterLogin', 550,335);
			}
			else
			{*/

			
				if(document.getElementById("relationsipdiv_" + intRec).style.display=="none")
				{
					/*document.getElementById('imageid_'+intRec).src= "images/arrowdown.gif"; */
					/*if(suserid == loginuserid)
					{
						document.getElementById("relationsipdiv_" + intRec).style.display="";
						document.getElementById("relationsipdiv_" + intRec).innerHTML="<br /><b><font color='#FF0000'>Sorry, you can not comment to yourself.</font></b>"; 
					}
					else
					{*/
						document.getElementById('issetfocus').value = "id_txtWhatAreUWorking_"+statusid;
						//fnAjaxCaller("relationsipdiv_" + intRec,"userhomepageV6","showreplytocomment","&recid=" + intRec + "&suserid=" + suserid + "&statusid=" + statusid + "&strredirectaxn=" + straction,"","");
					//}
					
					ajaxObjects[10] = new sack();
					ajaxObjects[10].requestFile = sitename+"/index.php?action=userhomepageV6&mode=ajax&ajax_action=showreplytocomment&recid=" + intRec + "&suserid=" + suserid + "&statusid=" + statusid + "&strredirectaxn=" + straction;
					//alert(ajaxObjects[10].requestFile);
					ajaxObjects[10].onCompletion = function(){
																document.getElementById("relationsipdiv_"+intRec).style.display = "";
																document.getElementById("relationsipdiv_"+intRec).innerHTML = ajaxObjects[10].response;
																document.getElementById("id_txtWhatAreUWorking_"+statusid).focus();
															};
					ajaxObjects[10].runAJAX();
				}
				else
				{
					/*document.getElementById('imageid_' + intRec).src= "images/arrowside.gif"; */
					document.getElementById("relationsipdiv_" + intRec).innerHTML=""; 
					document.getElementById("relationsipdiv_" + intRec).style.display="none";
					//ADDED BY ANAND
					try{
						ajax_hideTooltip();
					}
					catch(e){}
				}	
				
			//}
	}
	
	function fnHideShowCommentBox(loginuserid,statusid)
	{
		isLoad = false;
		/*if(loginuserid == 0 || loginuserid == "")
		{
			Lightbox.showBoxByID('divRegisterLogin', 550,335);
		}
		else
		{*/
			//alert("Open Box");
			//id_CommentBoxTd
			document.getElementById("id_CommentBoxTd_"+statusid).innerHTML=""; 
			document.getElementById('issetfocus').value = "id_txtWhatAreUWorking_"+statusid;
			fnAjaxCaller("id_CommentBoxTd_" + statusid,"userhomepageV6","showreplytocomment","&suserid=" + loginuserid + "&statusid=" + statusid + "&strredirectaxn=showallwruwo","","");
		/*}*/
	}
	
	function fnShowCommentBoxer(statusid)
	{
		if(document.getElementById("id_txtWhatAreUWorking_"+statusid).value == "" || document.getElementById("id_txtWhatAreUWorking_"+statusid).value == "Write a Comment...")
		{
			document.getElementById("id_txtWhatAreUWorking_"+statusid).style.height = "85px";
			document.getElementById("id_txtWhatAreUWorking_"+statusid).value = "";
			document.getElementById("submit_"+statusid).style.display = "";
			document.getElementById("id_txtWhatAreUWorking_"+statusid).focus();
		}
	}
	
	function fnViewAllComment(commentcnt,statusid)
	{
		for(i=2;i<=commentcnt;i++)
		{
			document.getElementById("id_tr_" + i + "_" + statusid).style.display="";
		}
		
		document.getElementById("id_maintr_" + statusid).style.display="none";
		
	}
	
	function fnIncreaseHieghtofTA(elementid)
	{
		elementid.style.height = elementid.scrollHeight + 'px';
	}
	
	function fnCheckConversationCharCnt(statusid)
	{ 
		var strText;
		var strTextLen;
		strDivId="id_txtWhatAreUWorking_"+statusid; 
		strCharDivId="id_charConvtextCnt_"+statusid; 
		strEnterButton = "submit_"+statusid;
		strText = document.getElementById(strDivId).value;
 		
			if(1000 - strText.length >= 20)
			{
				document.getElementById(strCharDivId).className = "charcount";
			}
			else if((1000 - strText.length < 20) &&  (1000 - strText.length > 10) )
			{					
				document.getElementById(strCharDivId).className = "charcount20";
			}
			else
			{
				document.getElementById(strCharDivId).className = "charcountnegative";
			}
			
			if(1000 - strText.length  < 0)
			{
				document.getElementById(strEnterButton).src = "images/Btn_SmallSubmit2.gif";
			}
			else
			{
				document.getElementById(strEnterButton).src = "images/Btn_SmallSubmit_Dis.gif";
			}
			if((1000 - strText.length <= 999) && (1000 - strText.length > -1)){ 
				try{
			  		ajax_hideTooltip();
				}
				catch(e){}
			}

			document.getElementById(strCharDivId).innerHTML = (1000 - strText.length); 
	}
	
	
	function fnValidateInputForCommentWAU(loginuserid,straction,txtRecId,eventid)
	{ 
		
		
		var strText;
		var strExtraparam;		

		if(txtRecId == "" || txtRecId == 0)
		{
			if(eventid)
			{
				strText = document.getElementById('id_txtEventWhatAreUWorking_'+txtRecId).value;
			}
			else
			{
				strText = document.getElementById('id_txtWhatAreUWorking_'+txtRecId).value;
			}
		
			strExtraparam = "";
		}
		else
		{
			if(eventid)
			{
				strText = document.getElementById('id_txtEventWhatAreUWorking_'+txtRecId).value;
				strExtraparam = "&parentid="+txtRecId+"&id="+eventid;
			}
			else
			{
				strText = document.getElementById('id_txtWhatAreUWorking_'+txtRecId).value;
				strExtraparam = "&parentid="+txtRecId;
			}
			
			
		}		
		
		if(strText == "")
		{
			strDivId= "submit_"+txtRecId;
			ajax_showTooltip('id_ErrorMessageCommentDiv',document.getElementById(strDivId),200,40);
			return false;
		}
		else if(1000 - strText.length  < 0)
		{
			strDivId= "submit_"+txtRecId;
			ajax_showTooltip('id_ErrorConvMessageExceedDiv',document.getElementById(strDivId),200,60);
			return false;
		}
		else
		{	 
		
			var myarry = new Array();
			myarry = strText.split(' '); 
			for (i=0;i<myarry.length;i++)
			{	
				if((myarry[i].length) >= 50)
				{	
					if((!myarry[i].match("http://")) && (!myarry[i].match("www")) && (!myarry[i].match("http://www")) && (!myarry[i].match("https://")))
					{ 
						ajax_showTooltip("id_GWLengthError",document.getElementById("submit_"+txtRecId),200,45);
						return false;
					}
				}
			}	
		
			if (parseInt(txtRecId) > 0)
				fnShowDefauleLoaderImage("id_GoodworkEnter_"+txtRecId,"id_GoodworkLoader_"+txtRecId);
			else
				fnShowDefauleLoaderImage("id_GoodworkEnter","id_GoodworkLoader");
			
			
			if(txtRecId == 0)
			{
				strText = strText.substring(0, 140);
			}
			
			strText = Base64.encode(strText);
	
		 	
			var ajaxIndex = ajaxObjects.length;	
			
			//ADDED BY ANAND
			var strLink = "";
			try
			{
				switch(siteid)
				{
					case "sg":
						strLink = sitename+"/index.php?action=sgajaxseventhgeneration&mode=ajax&ajax_action=sgsetsessionparams&settoparams=sgforwgwrud&location="+straction+"&txtWhatAreUWorking="+strText+"&parentid="+txtRecId;
					break;
					case "jm":
						strLink = sitename+"/index.php?action=setunsetsessionvars&mode=ajax&ajax_action=setsessionparams&settoparams=forwgwrud&location="+straction+"&txtWhatAreUWorking="+strText+"&parentid="+txtRecId+"&eventid="+eventid;
					break;
					default:
						strLink = sitename+"/index.php?action=setunsetsessionvars&mode=ajax&ajax_action=setsessionparams&settoparams=forwgwrud&location="+straction+"&txtWhatAreUWorking="+strText+"&parentid="+txtRecId+"&eventid="+eventid;
					break;
				}
			}
			catch(e)
			{
					
				strLink = sitename+"/index.php?action=setunsetsessionvars&mode=ajax&ajax_action=setsessionparams&settoparams=forwgwrud&location="+straction+"&txtWhatAreUWorking="+strText+"&parentid="+txtRecId+"&eventid="+eventid;
			}
			
			ajaxObjects[ajaxIndex] = new sack();			
			ajaxObjects[ajaxIndex].requestFile = strLink;
			ajaxObjects[ajaxIndex].onCompletion = function(){
																if(loginuserid == 0 || loginuserid == "")
																{
																		if (parseInt(txtRecId) > 0)
																			fnHideDefauleLoaderImage("id_GoodworkEnter_"+txtRecId,"id_GoodworkLoader_"+txtRecId);
																		else
																			fnHideDefauleLoaderImage("id_GoodworkEnter","id_GoodworkLoader");
																		//Lightbox.showBoxByID('divRegisterLogin', 570,345);
																		if(siteid=='sg')
																		{
																			Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
																		}
																		else
																		{
																			Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
																		}
																		return false;
																}
																else
																{
																	if(siteid == "sg")
																	{
																		fnProcessAjaxCode(34);	
																	}
																	else
																	{
																		ajaxObjects[1] = new sack();
																		ajaxObjects[1].requestFile = sitename+"/index.php?action=checkuseractype";
																		ajaxObjects[1].onCompletion = function(){
																													if (ajaxObjects[1].response == 1)
																													{
																														try
																														{
																															if (document.getElementById("id_hdnUserUpdates").value == "close")
																																fnShowPrivacyMessage();	
																														}
																														catch(e){}
																														
																														fnProcessAjaxCode(10);
																													}
																													else if (ajaxObjects[1].response == 2)
																													{
																														//Lightbox.showBoxByID('divRegisterLogin', 570,345);																												
																														if(siteid=='sg')
																														{
																															Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
																														}
																														else
																														{
																															Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
																														}
																														fnProcessAjaxCode(10);
																														document.getElementById('divRegisterLogin').innerHTML = "";
																														try
																														{
																															if (document.getElementById("id_hdnUserUpdates").value == "close" && document.getElementById('divRegisterLogin').style.display == "none")
																																fnShowPrivacyMessage();	
																														}
																														catch(e){}
																													}
																													else
																													{
																														//alert("You do not have permission to add \"What good work are you doing right now?\"");
																													}
																												}
																		ajaxObjects[1].runAJAX();
																	}
																	/*url=  sitename+"/index.php?action=addwhatuserworkingon&txtWhatAreUWorking="+strText+strExtraparam;																	
																	location.href = url;
																	return true;*/
																}
															};	// Specify function that will be executed after file has been found
			ajaxObjects[ajaxIndex].runAJAX();
		}
		
	}
	
	
function fnShowPrivacyMessage()
{
	ajax_showTooltip('id_privacymessage',document.getElementById("id_goodworktitle"),280,110);
}

function fnShowGoodWorkPopUp()
{
	document.getElementById("id_TmpGoodWorkHtml").innerHTML = document.getElementById("id_goodwork_1").innerHTML;
	document.getElementById("id_goodwork_1").innerHTML = document.getElementById("id_TmpGoodWorkMsgHtml").innerHTML;
	
	setTimeout('fnHideGoodWorkPopUp()', 4000)
}

function fnHideGoodWorkPopUp()
{
	document.getElementById("id_TmpGoodWorkMsgHtml").innerHTML = document.getElementById("id_goodwork_1").innerHTML;
	document.getElementById("id_goodwork_1").innerHTML = document.getElementById("id_TmpGoodWorkHtml").innerHTML;
}

function fnShowFormElements()
{
	try{
		document.getElementById("id_HideShow").style.display="block";	
	}
	catch (e){} 
}

function fnHideFormElements()
{
	try{
		document.getElementById("id_HideShow").style.display="none";	
	}
	catch (e){} 
}


/*
* FUNCTION fnFindPos()
* Retun object position array
* Parameter object id
*/
function fnFindPos(obj)
{
    var curleft = curtop = 0;  
    if (obj.offsetParent)
	{  
        curleft = obj.offsetLeft  
        curtop = obj.offsetTop  
        while (obj = obj.offsetParent)
		{  
            curleft += obj.offsetLeft  
            curtop += obj.offsetTop  
        }  
    }  
    return Array(curleft, curtop);
}

/*
* FUNCTION fnScrollWindow()
* Retun point to object
* Parameter object id
*/
function fnScrollWindow(strObjectId)
{
	arrDivPosition = fnFindPos(document.getElementById(strObjectId));
	window.scroll(0,arrDivPosition[1]);
}

var strPrevOpenDiv = "";
var strPrevSeperatorDiv = "";
function fnHideShowSubMenus(showdivid,divid,pagelocation)
{ 
	strPrevOpenDivId = document.getElementById("old_submenu").value; 
	strPrevOpenDiv = "id_submenu_"+strPrevOpenDivId;
	strPrevSeperatorDiv = "id_Seperator_"+strPrevOpenDivId;
	strArrowDiv = "id_ArrowExp_"+strPrevOpenDivId;
	document.getElementById(strArrowDiv).innerHTML = "<img src='images/mdc/ico_whiteArro.gif' />";
	
	if(strPrevOpenDiv!="")
		document.getElementById(strPrevOpenDiv).style.display = "none";
	if(strPrevSeperatorDiv!="")
		document.getElementById(strPrevSeperatorDiv).style.display = "none";
		
	document.getElementById(showdivid).style.display = "";
	strSeperatorDiv = "id_Seperator_"+divid;
	document.getElementById(strSeperatorDiv).style.display = "";
	strArrowDiv = "id_ArrowExp_"+divid;
	document.getElementById(strArrowDiv).innerHTML = "<img src='images/mdc/ico_whiteArroExp.gif' />";
	
	document.getElementById("old_submenu").value = divid;
	if(pagelocation!="")
		window.location.href = sitename+"/"+pagelocation;
}



/* ==================== AMOL START 19-06-09 ===================== */

function fnDisplayReplyCommentBox(intStatusId)
	{
		var elem = document.getElementById("id_CommentBoxTd_"+ intStatusId);
		if(elem.style.display=="")
		{
				elem.style.display = "none";
		}
		else
		{
				elem.style.display = "";
		}
		
	}
	
	function fnSetClass(statusid)
	{
		document.getElementById("id_txtWhatAreUWorking_"+ statusid).className = "inputblack";
	}
	
	/*
	
	function fnShowCommentBoxer(statusid)
	{
		if(document.getElementById("id_txtWhatAreUWorking_"+statusid).value == "" || document.getElementById("id_txtWhatAreUWorking_"+statusid).value == "Write a Comment...")
		{
			document.getElementById("id_txtWhatAreUWorking_"+statusid).style.height = "85px";
			document.getElementById("id_txtWhatAreUWorking_"+statusid).value = "";
			document.getElementById("submit_"+statusid).style.display = "";
			document.getElementById("id_txtWhatAreUWorking_"+statusid).focus();
		}
	}
	
	*/
	
		function fnChkCommentTxt(loginuserid,straction,txtRecId,txtque,txttype)
	{ 
		var strText;
		var strExtraparam;

		if(txtRecId == "" || txtRecId == 0)
		{
			strText = document.getElementById('id_txtWhatAreUWorking').value;
			strExtraparam = "";
		}
		else
		{
			strText = document.getElementById('id_txtWhatAreUWorking_'+txtRecId).value;
			strExtraparam = "&parentid="+txtRecId;
		}		
		
		if(strText == "" || strText == "Write a Comment...")
		{
			ajax_showTooltip('id_ErrCommentDiv',document.getElementById("submit_"+txtRecId),250,30);
			//alert("Enter Text For 'What good work are you doing right now?' ");
			return false;
		}
		else if(1000 - strText.length  < 0)
		{
			strDivId= "submit_"+txtRecId;
			ajax_showTooltip('id_ErrorConvMessageExceedDiv',document.getElementById(strDivId),280,50);
			return false;
		}
		else
		{
			if (parseInt(txtRecId) > 0)
				fnShowDefauleLoaderImage("id_GoodworkEnter_"+txtRecId,"id_GoodworkLoader_"+txtRecId);
			else
				{
					fnShowDefauleLoaderImage("id_GoodworkEnter","id_GoodworkLoader");
					strText = strText.substring(0, 140);
				}
			//strText = escape(strText);
	 		//strText = strText.replace(/\r?\n/g,'<br/>');
			strText =  Base64.encode(strText);
		
			var ajaxIndex = ajaxObjects.length;	
			ajaxObjects[ajaxIndex] = new sack();
			ajaxObjects[ajaxIndex].requestFile = sitename+"/index.php?action=setunsetsessionvars&mode=ajax&ajax_action=setsessionparams&settoparams=forwgwrud&location="+straction+"&txtWhatAreUWorking="+strText+"&parentid="+txtRecId+"&que="+txtque+"&s="+txttype;
			ajaxObjects[ajaxIndex].onCompletion = function(){
																if(loginuserid == 0 || loginuserid == "")
																{
																	if (parseInt(txtRecId) > 0)
																		fnHideDefauleLoaderImage("id_GoodworkEnter_"+txtRecId,"id_GoodworkLoader_"+txtRecId);
																	else
																		fnHideDefauleLoaderImage("id_GoodworkEnter","id_GoodworkLoader");
																	Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
																	return false;
																}
																else
																{
																	ajaxObjects[1] = new sack();			
																	ajaxObjects[1].requestFile = sitename+"/index.php?action=checkuseractype";
																	ajaxObjects[1].onCompletion = function(){
																												if (ajaxObjects[1].response == 1)
																												{
																													fnProcessAjaxCode(10);
																												}
																												else if (ajaxObjects[1].response == 2)
																												{
																													document.getElementById('divRegisterLogin').innerHTML = "";
																													//Lightbox.showBoxByID('divRegisterLogin', 560,345);
																													Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
																													fnProcessAjaxCode(10);
																												}
																												else
																												{
																													//alert("You do not have permission to add \"What good work are you doing right now?\"");
																												}
																											}
																	ajaxObjects[1].runAJAX();
																	/*document.getElementById('divRegisterLogin').innerHTML = "";
																	Lightbox.showBoxByID('divRegisterLogin', 550,345);
																	fnProcessAjaxCode(10);*/
																}
															};	// Specify function that will be executed after file has been found
			ajaxObjects[ajaxIndex].runAJAX();
			
			
		}
		
	}
	
	
	
/* ==================== AMOL END ===================== */


function fnGetAllCompanyAdmn()
{
	//1. get ajax call. get the cnt of company has accessrights
	ajaxObjects[0] = new sack();
	ajaxObjects[0].requestFile = sitename+"/index.php?action=getcompanyadmininfo";
	ajaxObjects[0].onCompletion = function(){  
													if(ajaxObjects[0].response == 1)
													{
														// set session using ajax and redirect to company admin
														ajaxObjects[1] = new sack();
														
														ajaxObjects[1].requestFile = sitename+"/index.php?action=setcompanyadminsession";
														ajaxObjects[1].onCompletion = function()
														{
															location.href = sitename+"/companyprofile";
														}	
														ajaxObjects[1].runAJAX();
													}
													else
													{															
														// get the html code and print on autocomplete box
														Lightbox.showBoxByAJAX(sitename+"/showcompanyadminoptions", 580,375);
													}
											};
	ajaxObjects[0].runAJAX();
}


function fnChkAllSelectCommentType()
	{	
		var strSlectedCompanyId;
		var strEncodeSlectedCompanyId;
		fnShowDefauleLoaderImage("id_LoginButton","id_LoginLoader");
		// require at least one radio button be selected
		var radioSelected = false;
		for (i = 0;  i < document.frmSelectCommentAdminType.rdbSelectType.length;  i++)
		{
			if (document.frmSelectCommentAdminType.rdbSelectType[i].checked)
			{
				radioSelected = true;
				strSlectedCompanyId = document.frmSelectCommentAdminType.rdbSelectType[i].value;
			}
		}
		if (!radioSelected)
		{
			alert("Choose \"Company Administration\" from following options.");
			return false;
		}
		strEncodeSlectedCompanyId = Base64.encode(strSlectedCompanyId);
		try
		{
			var strAccountType;
			if(document.getElementById('id_hiddenAccountType').value == 1)
			{
				var strAccountType = "c"
			}
			else
			{
				strAccountType = "";
			}
		}
		catch(e){}
		// set session using ajax and redirect to company admin
		ajaxObjects[1] = new sack();
		
		ajaxObjects[1].requestFile = sitename+"/setcompanyadminsession?companyid="+strEncodeSlectedCompanyId+"&type="+strAccountType;		
		ajaxObjects[1].onCompletion = function()
		{
			location.href = sitename+"/companyprofile";
		}	
		ajaxObjects[1].runAJAX();
		
		return false;
	}
/*------------ userhomepageV6.js ---------------*/

/*------------ imageloader.js ------------------*/
function fnShowDefauleLoaderImage(strButtonImageDiv, strLoaderImageDiv)
{
	try{
			document.getElementById(strButtonImageDiv).style.display = "none";
			document.getElementById(strLoaderImageDiv).innerHTML = '<img src="images/ajax-loader-bar.gif" align="left" vspace="3" />';
			//setTimeout("fnHideDefauleLoaderImage('" + strButtonImageDiv + "','" + strLoaderImageDiv + "')", 6000);
	}
	catch(e)
	{}
}

function fnHideDefauleLoaderImage(strButtonImageDiv, strLoaderImageDiv)
{ 
	try{
			document.getElementById(strButtonImageDiv).style.display = "";
			document.getElementById(strLoaderImageDiv).innerHTML = "";
	}
	catch(e)
	{}
}
/*------------ imageloader.js ------------------*/

/*------------ follow.js ------------------*/
/**
* Contact Module JS Files
* @author Pathfinder Solutions India
* @link http://www.pathfindersolutions.biz
* @version 1.0
* @package justmeans
* @subpackage contact
*/


function fnFollowspam(intLoginInUserId, intContactUserId, strContactUserType, intRandNumber)
{
	fnShowDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
	if (intContactUserId == "" || strContactUserType == "")
		return false;		
		
	var  strpagelocation = sitename+'/index.php?action=myprofile&user='+intContactUserId;
	var ajaxObjects = new Array();
	ajaxObjects[0] = new sack();
	ajaxObjects[0].requestFile = sitename+"/index.php?action=setunsetsessionvars&mode=ajax&ajax_action=setsessionparams&settoparams=followuser&contactuserid="+intContactUserId+"&contactusertype="+strContactUserType;
	ajaxObjects[0].onCompletion = function(){ 
												if(intRandNumber == '13831')
												{
													fnFollowSentUserRequest(intLoginInUserId, intContactUserId, strContactUserType, intRandNumber,strpagelocation);
												}
												else
												{
													fnFollowUserRequest(intLoginInUserId, intContactUserId, strContactUserType, intRandNumber);
												}
											};
	ajaxObjects[0].runAJAX();				
	
				
//////////////////////////////////////////////////////////////////////
}



function fnFollowUser(intLoginInUserId, intContactUserId, strContactUserType, intRandNumber)
{	


	
	
	fnShowDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
	if (intContactUserId == "" || strContactUserType == "")
		return false;		
		
	var  strpagelocation = sitename+'/index.php?action=myprofile&user='+intContactUserId;
	var ajaxObjects = new Array();
	ajaxObjects[0] = new sack();
	ajaxObjects[0].requestFile = sitename+"/index.php?action=setunsetsessionvars&mode=ajax&ajax_action=setsessionparams&settoparams=followuser&contactuserid="+intContactUserId+"&contactusertype="+strContactUserType;
	ajaxObjects[0].onCompletion = function(){ 
												if(intRandNumber == '13831')
												{
													fnFollowSentUserRequest(intLoginInUserId, intContactUserId, strContactUserType, intRandNumber,strpagelocation);
												}
												else
												{
													fnFollowUserRequest(intLoginInUserId, intContactUserId, strContactUserType, intRandNumber);
												}
											};
	ajaxObjects[0].runAJAX();
	
	
	
}

function fnFollowMedia(intLoginInUserId, intMediaId, strMediaType, intRandNumber, intGetFollowerCount, intFromMenu)
{ 

	fnShowDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
	if (intMediaId == "" || strMediaType == "")
		return false;
		
	//var  strpagelocation = sitename+'/index.php?action=myprofile&user='+intContactUserId;
	var ajaxObjects = new Array();
	ajaxObjects[0] = new sack();
	ajaxObjects[0].requestFile = sitename+"/index.php?action=setunsetsessionvars&mode=ajax&ajax_action=setsessionparams&settoparams=followmedia&mediaid="+intMediaId+"&mediatype="+strMediaType;
	ajaxObjects[0].onCompletion = function(){ 
												fnFollowMediaRequest(intLoginInUserId, intMediaId, strMediaType, intRandNumber, intGetFollowerCount, intFromMenu);
											};
	ajaxObjects[0].runAJAX();
}

function fnFollowUserRequest(intLoginInUserId, intContactUserId, strContactUserType, intRandNumber)
{ 
	try
	{

		enmChangeImages = document.getElementById("id_hdnImageChange_"+intRandNumber).value;
		strEncodedImages = document.getElementById("id_hdnImageHtml_"+intRandNumber).value;

		if(intLoginInUserId == 0 || intLoginInUserId == "")
		{
			
			//Lightbox.showBoxByID('divRegisterLogin', 560,345);
			Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
			fnHideDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
		}
		else
		{
			
			ajaxObjects[1] = new sack(); 
			ajaxObjects[1].requestFile = sitename+"/index.php?action=addfollowuser&mode=ajax&isbyajax=1&changeimages="+strEncodedImages+"&encodedimages="+enmChangeImages+"&rand="+intRandNumber;
			ajaxObjects[1].onCompletion = function(){
														//var lookup = (ajaxObjects[1].response);	
														
														var totalresponse = ajaxObjects[1].response;															
														var mytool_array = totalresponse.split("|");															
														var lookup = (mytool_array[0]);
														var parentlookup = (mytool_array[1]);
															
															
														 switch(lookup)
														 {
															case "9":
																document.getElementById('id_ErrorMessageSpam').innerHTML = "<b>Your IP has been blocked for any more following.</b>";
																ajax_showTooltip("id_ErrorMessageSpam",document.getElementById("id_ConnectImage_"+intRandNumber),200,45);
																fnHideDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
																setTimeout("fnHideMessage("+"'id_ErrorMessageSpam')",1000);
																return false;																	
															break;
															
															case "99":
																document.getElementById('id_ErrorMessageSpam').innerHTML = "<b>Your account has been blocked from following any more contacts today.</b>";
																ajax_showTooltip("id_ErrorMessageSpam",document.getElementById("id_ConnectImage_"+intRandNumber),200,45);
																fnHideDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
																setTimeout("fnHideMessage("+"'id_ErrorMessageSpam')",1000);
																return false;																											
															break;											
															
															case "199":
																location.href = sitename+"/index.php?action=logout&spamerror=1";													
															break;
															
															case "999":															
																fnHideDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
																fnShowLastMessages(intRandNumber);
																document.getElementById("id_ConnectImage_"+intRandNumber).innerHTML = parentlookup;
															break;
															
															default:															
																fnHideDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
																fnShowMessages(intRandNumber);
																document.getElementById("id_ConnectImage_"+intRandNumber).innerHTML = ajaxObjects[1].response;
															break;
														 }
													};
			ajaxObjects[1].runAJAX();
		}
	}
	catch(e)
	{
		
		ajaxObjects[1] = new sack();
		ajaxObjects[1].requestFile = sitename+"/index.php?action=addfollowuser&mode=ajax&isbyajax=1";
		ajaxObjects[1].onCompletion = function(){ 
													//document.getElementById("id_ConnectImage_"+intRandNumber).innerHTML = ajaxObjects[1].response;
												};
		ajaxObjects[1].runAJAX();
		fnHideDefauleLoaderImage("id_loaderImage_"+intRandNumber);
	}
}


function fnFollowAllUserRequest(intLoginInUserId, intContactUserId, strContactUserType, intRandNumber, intCategoryId, strToFollow)
{  	
	fnShowDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
	
	try
	{
		if(intLoginInUserId == 0 || intLoginInUserId == "")
		{
			Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
			fnHideDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
		}
		else
		{
			var ajaxObjects = new Array();
			ajaxObjects[10] = new sack(); 
			ajaxObjects[10].requestFile = sitename+"/index.php?action=addfollowallusers&arrContactUserId="+intContactUserId+"&contactuertype="+strContactUserType+"&rand="+intRandNumber;
			ajaxObjects[10].onCompletion = function(){  
														//alert(ajaxObjects[10].response);
														fnGetNewCategoryFollowers(intCategoryId,strContactUserType,intRandNumber,strToFollow);
													};
			ajaxObjects[10].runAJAX();
		}
	}
	catch(e)
	{
		
		ajaxObjects[10] = new sack();
		ajaxObjects[10].requestFile = sitename+"/index.php?action=addfollowuser&mode=ajax&isbyajax=1";
		ajaxObjects[10].onCompletion = function(){ 
													//document.getElementById("id_ConnectImage_"+intRandNumber).innerHTML = ajaxObjects[1].response;
												};
		ajaxObjects[10].runAJAX();
		fnHideDefauleLoaderImage("id_loaderImage_"+intRandNumber);
	}
}


function fnGetNewCategoryFollowers(intCategoryId, strContactUserType ,intRandNumber, strToFollow)
{ 

	fnShowDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
	if (intCategoryId == "" || strContactUserType == "")
		return false;
		
	//var  strpagelocation = sitename+'/index.php?action=myprofile&user='+intContactUserId;
	var ajaxObjects = new Array();
	ajaxObjects[0] = new sack();
	ajaxObjects[0].requestFile = sitename+"/index.php?action=categoryfollowers&mode=ajax&ajax_action=getcategoryfollowerss&isByAjax=1&categoryid="+intCategoryId+"&usertype="+strContactUserType+"&height=29&width=29";
	ajaxObjects[0].onCompletion = function(){  
												//alert(ajaxObjects[0].response);
												fnHideDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
												fnShowMessages(intRandNumber);
												document.getElementById("refreshThis_"+strToFollow).innerHTML = ajaxObjects[0].response;
											};
	ajaxObjects[0].runAJAX();
}


function fnFollowMediaRequest(intLoginInUserId, intContactUserId, strContactUserType, intRandNumber, intGetFollowerCount, intFromMenu)
{ 
	try
	{
		if(intLoginInUserId == 0 || intLoginInUserId == "")
		{
			Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
			fnHideDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
		}
		else
		{
			ajaxObjects[1] = new sack();
			ajaxObjects[1].requestFile = sitename+"/index.php?action=addfollowmedia&mode=ajax&isbyajax=1&rand="+intRandNumber+"&getfollowercount="+intGetFollowerCount+"&frommenu="+intFromMenu;
			ajaxObjects[1].onCompletion = function(){ 
														fnHideDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
														fnShowMessages(intRandNumber);
														document.getElementById("id_ConnectImage_"+intRandNumber).innerHTML = ajaxObjects[1].response;
													};
			ajaxObjects[1].runAJAX();
		}
	}
	catch(e)
	{
		
		ajaxObjects[1] = new sack();
		ajaxObjects[1].requestFile = sitename+"/index.php?action=addfollowmedia&mode=ajax&isbyajax=1";
		ajaxObjects[1].onCompletion = function(){ 
													//document.getElementById("id_ConnectImage_"+intRandNumber).innerHTML = ajaxObjects[1].response;
												};
		ajaxObjects[1].runAJAX();
		fnHideDefauleLoaderImage("id_loaderImage_"+intRandNumber);
	}
}

function fnUnfollowUser(intLoginInUserId, intContactUserId, strContactUserType, intRandNumber)
{
	fnShowDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
	enmChangeImages = document.getElementById("id_hdnImageChange_"+intRandNumber).value;
	strEncodedImages = document.getElementById("id_hdnImageHtml_"+intRandNumber).value;
	
	if (intContactUserId == "" || strContactUserType == "")
		return false;
		
	var ajaxObjects = new Array();
	ajaxObjects[2] = new sack();
	ajaxObjects[2].requestFile = sitename+"/index.php?action=removefollowuser&mode=ajax&contactuserid="+intContactUserId+"&contactusertype="+strContactUserType+"&changeimages="+strEncodedImages+"&encodedimages="+enmChangeImages+"&rand="+intRandNumber;
	ajaxObjects[2].onCompletion = function(){ 
												document.getElementById("id_ConnectImage_"+intRandNumber).innerHTML = ajaxObjects[2].response;
												fnHideDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
											};
	ajaxObjects[2].runAJAX();
}

function fnUnfollowMedia(intLoginInUserId, intMediaId, strMediaType, intRandNumber, intGetFollowerCount, intFromMenu)
{
	fnShowDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
	/*enmChangeImages = document.getElementById("id_hdnImageChange_"+intRandNumber).value;
	strEncodedImages = document.getElementById("id_hdnImageHtml_"+intRandNumber).value;*/
	
	if (intMediaId == "" || strMediaType == "")
		return false;
		
	var ajaxObjects = new Array();
	ajaxObjects[2] = new sack();
	ajaxObjects[2].requestFile = sitename+"/index.php?action=removefollowmedia&mode=ajax&mediaid="+intMediaId+"&mediatype="+strMediaType+"&rand="+intRandNumber+"&getfollowercount="+intGetFollowerCount+"&frommenu="+intFromMenu;
	ajaxObjects[2].onCompletion = function(){ 
												document.getElementById("id_ConnectImage_"+intRandNumber).innerHTML = ajaxObjects[2].response;
												fnHideDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
											};
	ajaxObjects[2].runAJAX();
}


function fnShowMessages(intRandNumber)
{
	boolAutoHide = true;
	ajax_showTooltip("id_followmessage_"+intRandNumber,document.getElementById("id_ConnectImage_"+intRandNumber),200,45);
	setTimeout("fnHideMessage("+"'id_ConnectImage_"+intRandNumber+"')",3000);
}

function fnShowLastMessages(intRandNumber)
{
	boolAutoHide = true;
	var lastmsg = document.getElementById("id_followmessage_"+intRandNumber).innerHTML;
	lastmsg = lastmsg + "<br><b>This is your last chance to follow.</b>";
	document.getElementById("id_followmessage_"+intRandNumber).innerHTML = lastmsg;	
	ajax_showTooltip("id_followmessage_"+intRandNumber,document.getElementById("id_ConnectImage_"+intRandNumber),200,45);
	setTimeout("fnHideMessage("+"'id_ConnectImage_"+intRandNumber+"')",3000);
}

function fnHideMessage(strDivId)
{
	if (boolAutoHide == true)
	{
		ajax_hideTooltip(strDivId);
	}
}


/*********************************************************************************/
//Function for Sent Messge btn for Myprofile 
/*********************************************************************************/
function fnFollowSentUser(intLoginInUserId, intContactUserId, strContactUserType, intRandNumber)
{
	
	
	document.getElementById("id_btnSent").style.display ='none';
	fnShowDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
	if (intContactUserId == "" || strContactUserType == "")
		return false;
		
	var  strpagelocation = sitename+'/index.php?action=myprofile&user='+intContactUserId;
	var ajaxObjects = new Array();
	ajaxObjects[0] = new sack();
	ajaxObjects[0].requestFile = sitename+"/index.php?action=setunsetsessionvars&mode=ajax&ajax_action=setsessionparams&settoparams=followuser&contactuserid="+intContactUserId+"&contactusertype="+strContactUserType;
	ajaxObjects[0].onCompletion = function(){ 
												fnFollowSentUserRequest(intLoginInUserId, intContactUserId, strContactUserType, intRandNumber,strpagelocation);												
											};
	ajaxObjects[0].runAJAX();
}

//Function for Sent Messge btn for Myprofile 

function fnFollowSentUserRequest(intLoginInUserId, intContactUserId, strContactUserType, intRandNumber , strpagelocation)
{
	try
	{
		if(intLoginInUserId == 0 || intLoginInUserId == "")
		{			
			//Lightbox.showBoxByID('divRegisterLogin', 560,345);
			Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
			fnHideDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
		}
		else
		{			
			ajaxObjects[1] = new sack();
			ajaxObjects[1].requestFile = sitename+"/index.php?action=addfollowuser&mode=ajax&isbyajax=1&rand="+intRandNumber;
			
			ajaxObjects[1].onCompletion = function(){ 
														fnHideDefauleLoaderImage("id_FollowButton_"+intRandNumber, "id_FollowLoader_"+intRandNumber);
														//fnShowMessages(intRandNumber);
														//ajax_showTooltip("id_followmessage_"+intRandNumber,document.getElementById("relationsipdiv"),200,45);													
														window.location.href=strpagelocation;
														//document.getElementById("id_ConnectImage_"+intRandNumber).innerHTML = ajaxObjects[1].response;														
													};
			ajaxObjects[1].runAJAX();
		}
	}
	catch(e)
	{
		ajaxObjects[1] = new sack();
		ajaxObjects[1].requestFile = sitename+"/index.php?action=addfollowuser&mode=ajax&isbyajax=1";
		ajaxObjects[1].onCompletion = function(){ 		
													//document.getElementById("id_ConnectImage_"+intRandNumber).innerHTML = ajaxObjects[1].response;
												};
		ajaxObjects[1].runAJAX();
		fnHideDefauleLoaderImage("id_loaderImage_"+intRandNumber);
	}
}
/*------------ follow.js ------------------*/

/*------------ urchin.js ------------------*/
//-- Google Analytics Urchin Module
//-- Copyright 2007 Google, All Rights Reserved.

//-- Urchin On Demand Settings ONLY
var _uacct="";			// set up the Urchin Account
var _userv=1;			// service mode (0=local,1=remote,2=both)

//-- UTM User Settings
var _ufsc=1;			// set client info flag (1=on|0=off)
var _udn="auto";		// (auto|none|domain) set the domain name for cookies
var _uhash="on";		// (on|off) unique domain hash for cookies
var _utimeout="1800";   	// set the inactive session timeout in seconds
var _ugifpath="/__utm.gif";	// set the web path to the __utm.gif file
var _utsp="|";			// transaction field separator
var _uflash=1;			// set flash version detect option (1=on|0=off)
var _utitle=1;			// set the document title detect option (1=on|0=off)
var _ulink=0;			// enable linker functionality (1=on|0=off)
var _uanchor=0;			// enable use of anchors for campaign (1=on|0=off)
var _utcp="/";			// the cookie path for tracking
var _usample=100;		// The sampling % of visitors to track (1-100).

//-- UTM Campaign Tracking Settings
var _uctm=1;			// set campaign tracking module (1=on|0=off)
var _ucto="15768000";		// set timeout in seconds (6 month default)
var _uccn="utm_campaign";	// name
var _ucmd="utm_medium";		// medium (cpc|cpm|link|email|organic)
var _ucsr="utm_source";		// source
var _uctr="utm_term";		// term/keyword
var _ucct="utm_content";	// content
var _ucid="utm_id";		// id number
var _ucno="utm_nooverride";	// don't override

//-- Auto/Organic Sources and Keywords
var _uOsr=new Array();
var _uOkw=new Array();
_uOsr[0]="google";	_uOkw[0]="q";
_uOsr[1]="yahoo";	_uOkw[1]="p";
_uOsr[2]="msn";		_uOkw[2]="q";
_uOsr[3]="aol";		_uOkw[3]="query";
_uOsr[4]="aol";		_uOkw[4]="encquery";
_uOsr[5]="lycos";	_uOkw[5]="query";
_uOsr[6]="ask";		_uOkw[6]="q";
_uOsr[7]="altavista";	_uOkw[7]="q";
_uOsr[8]="netscape";	_uOkw[8]="query";
_uOsr[9]="cnn";	_uOkw[9]="query";
_uOsr[10]="looksmart";	_uOkw[10]="qt";
_uOsr[11]="about";	_uOkw[11]="terms";
_uOsr[12]="mamma";	_uOkw[12]="query";
_uOsr[13]="alltheweb";	_uOkw[13]="q";
_uOsr[14]="gigablast";	_uOkw[14]="q";
_uOsr[15]="voila";	_uOkw[15]="rdata";
_uOsr[16]="virgilio";	_uOkw[16]="qs";
_uOsr[17]="live";	_uOkw[17]="q";
_uOsr[18]="baidu";	_uOkw[18]="wd";
_uOsr[19]="alice";	_uOkw[19]="qs";
_uOsr[20]="yandex";	_uOkw[20]="text";
_uOsr[21]="najdi";	_uOkw[21]="q";
_uOsr[22]="aol";	_uOkw[22]="q";
_uOsr[23]="club-internet"; _uOkw[23]="query";
_uOsr[24]="mama";	_uOkw[24]="query";
_uOsr[25]="seznam";	_uOkw[25]="q";
_uOsr[26]="search";	_uOkw[26]="q";
_uOsr[27]="wp";	_uOkw[27]="szukaj";
_uOsr[28]="onet";	_uOkw[28]="qt";
_uOsr[29]="netsprint";	_uOkw[29]="q";
_uOsr[30]="google.interia";	_uOkw[30]="q";
_uOsr[31]="szukacz";	_uOkw[31]="q";
_uOsr[32]="yam";	_uOkw[32]="k";
_uOsr[33]="pchome";	_uOkw[33]="q";
_uOsr[34]="kvasir";	_uOkw[34]="searchExpr";
_uOsr[35]="sesam";	_uOkw[35]="q";
_uOsr[36]="ozu"; _uOkw[36]="q";
_uOsr[37]="terra"; _uOkw[37]="query";
_uOsr[38]="nostrum"; _uOkw[38]="query";
_uOsr[39]="mynet"; _uOkw[39]="q";
_uOsr[40]="ekolay"; _uOkw[40]="q";
_uOsr[41]="search.ilse"; _uOkw[41]="search_for";
_uOsr[42]="bing"; _uOkw[42]="q";

//-- Auto/Organic Keywords to Ignore
var _uOno=new Array();
//_uOno[0]="urchin";
//_uOno[1]="urchin.com";
//_uOno[2]="www.urchin.com";

//-- Referral domains to Ignore
var _uRno=new Array();
//_uRno[0]=".urchin.com";

//-- **** Don't modify below this point ***
var _uff,_udh,_udt,_ubl=0,_udo="",_uu,_ufns=0,_uns=0,_ur="-",_ufno=0,_ust=0,_ubd=document,_udl=_ubd.location,_udlh="",_uwv="1.3";
var _ugifpath2="http://www.google-analytics.com/__utm.gif";
if (_udl.hash) _udlh=_udl.href.substring(_udl.href.indexOf('#'));
if (_udl.protocol=="https:") _ugifpath2="https://ssl.google-analytics.com/__utm.gif";
if (!_utcp || _utcp=="") _utcp="/";
function urchinTracker(page) {
 if (_udl.protocol=="file:") return;
 if (_uff && (!page || page=="")) return;
 var a,b,c,xx,v,z,k,x="",s="",f=0,nv=0;
 var nx=" expires="+_uNx()+";";
 var dc=_ubd.cookie;
 _udh=_uDomain();
 if (!_uVG()) return;
 _uu=Math.round(Math.random()*2147483647);
 _udt=new Date();
 _ust=Math.round(_udt.getTime()/1000);
 a=dc.indexOf("__utma="+_udh+".");
 b=dc.indexOf("__utmb="+_udh);
 c=dc.indexOf("__utmc="+_udh);
 if (_udn && _udn!="") { _udo=" domain="+_udn+";"; }
 if (_utimeout && _utimeout!="") {
  x=new Date(_udt.getTime()+(_utimeout*1000));
  x=" expires="+x.toGMTString()+";";
 }
 if (_ulink) {
  if (_uanchor && _udlh && _udlh!="") s=_udlh+"&";
  s+=_udl.search;
  if(s && s!="" && s.indexOf("__utma=")>=0) {
   if (!(_uIN(a=_uGC(s,"__utma=","&")))) a="-";
   if (!(_uIN(b=_uGC(s,"__utmb=","&")))) b="-";
   if (!(_uIN(c=_uGC(s,"__utmc=","&")))) c="-";
   v=_uGC(s,"__utmv=","&");
   z=_uGC(s,"__utmz=","&");
   k=_uGC(s,"__utmk=","&");
   xx=_uGC(s,"__utmx=","&");
   if ((k*1) != ((_uHash(a+b+c+xx+z+v)*1)+(_udh*1))) {_ubl=1;a="-";b="-";c="-";xx="-";z="-";v="-";}
   if (a!="-" && b!="-" && c!="-") f=1;
   else if(a!="-") f=2;
  }
 }
 if(f==1) {
  _ubd.cookie="__utma="+a+"; path="+_utcp+";"+nx+_udo;
  _ubd.cookie="__utmb="+b+"; path="+_utcp+";"+x+_udo;
  _ubd.cookie="__utmc="+c+"; path="+_utcp+";"+_udo;
 } else if (f==2) {
  a=_uFixA(s,"&",_ust);
  _ubd.cookie="__utma="+a+"; path="+_utcp+";"+nx+_udo;
  _ubd.cookie="__utmb="+_udh+"; path="+_utcp+";"+x+_udo;
  _ubd.cookie="__utmc="+_udh+"; path="+_utcp+";"+_udo;
  _ufns=1;
 } else if (a>=0 && b>=0 && c>=0) {
   b = _uGC(dc,"__utmb="+_udh,";");
   b = ("-" == b) ? _udh : b;  
  _ubd.cookie="__utmb="+b+"; path="+_utcp+";"+x+_udo;
 } else {
  if (a>=0) a=_uFixA(_ubd.cookie,";",_ust);
  else {
   a=_udh+"."+_uu+"."+_ust+"."+_ust+"."+_ust+".1";
   nv=1;
  }
  _ubd.cookie="__utma="+a+"; path="+_utcp+";"+nx+_udo;
  _ubd.cookie="__utmb="+_udh+"; path="+_utcp+";"+x+_udo;
  _ubd.cookie="__utmc="+_udh+"; path="+_utcp+";"+_udo;
  _ufns=1;
 }
 if (_ulink && xx && xx!="" && xx!="-") {
   xx=_uUES(xx);
   if (xx.indexOf(";")==-1) _ubd.cookie="__utmx="+xx+"; path="+_utcp+";"+nx+_udo;
 }
 if (_ulink && v && v!="" && v!="-") {
  v=_uUES(v);
  if (v.indexOf(";")==-1) _ubd.cookie="__utmv="+v+"; path="+_utcp+";"+nx+_udo;
 }
 var wc=window;
 var c=_ubd.cookie;
 if(wc && wc.gaGlobal && wc.gaGlobal.dh==_udh){
  var g=wc.gaGlobal;
  var ua=c.split("__utma="+_udh+".")[1].split(";")[0].split(".");
  if(g.sid)ua[3]=g.sid;
  if(nv>0){
   ua[2]=ua[3];
   if(g.vid){
    var v=g.vid.split(".");
    ua[0]=v[0];
    ua[1]=v[1];
   }
  }
  _ubd.cookie="__utma="+_udh+"."+ua.join(".")+"; path="+_utcp+";"+nx+_udo;
 }
 _uInfo(page);
 _ufns=0;
 _ufno=0;
 if (!page || page=="") _uff=1;
}
function _uGH() {
 var hid;
 var wc=window;
 if (wc && wc.gaGlobal && wc.gaGlobal.hid) {
  hid=wc.gaGlobal.hid;
 } else {
  hid=Math.round(Math.random()*0x7fffffff);
  if (!wc.gaGlobal) wc.gaGlobal={};
  wc.gaGlobal.hid=hid;
 }
 return hid;
}
function _uInfo(page) {
 var p,s="",dm="",pg=_udl.pathname+_udl.search;
 if (page && page!="") pg=_uES(page,1);
 _ur=_ubd.referrer;
 if (!_ur || _ur=="") { _ur="-"; }
 else {
  dm=_ubd.domain;
  if(_utcp && _utcp!="/") dm+=_utcp;
  p=_ur.indexOf(dm);
  if ((p>=0) && (p<=8)) { _ur="0"; }
  if (_ur.indexOf("[")==0 && _ur.lastIndexOf("]")==(_ur.length-1)) { _ur="-"; }
 }
 s+="&utmn="+_uu;
 if (_ufsc) s+=_uBInfo();
 if (_uctm) s+=_uCInfo();
 if (_utitle && _ubd.title && _ubd.title!="") s+="&utmdt="+_uES(_ubd.title);
 if (_udl.hostname && _udl.hostname!="") s+="&utmhn="+_uES(_udl.hostname);
 if (_usample && _usample != 100) s+="&utmsp="+_uES(_usample);
 s+="&utmhid="+_uGH();
 s+="&utmr="+_ur;
 s+="&utmp="+pg;
 if ((_userv==0 || _userv==2) && _uSP()) {
  var i=new Image(1,1);
  i.src=_ugifpath+"?"+"utmwv="+_uwv+s;
  i.onload=function() { _uVoid(); }
 }
 if ((_userv==1 || _userv==2) && _uSP()) {
  var i2=new Image(1,1);
  i2.src=_ugifpath2+"?"+"utmwv="+_uwv+s+"&utmac="+_uacct+"&utmcc="+_uGCS();
  i2.onload=function() { _uVoid(); }
 }
 return;
}
function _uVoid() { return; }
function _uCInfo() {
 if (!_ucto || _ucto=="") { _ucto="15768000"; }
 if (!_uVG()) return;
 var c="",t="-",t2="-",t3="-",o=0,cs=0,cn=0,i=0,z="-",s="";
 if (_uanchor && _udlh && _udlh!="") s=_udlh+"&";
 s+=_udl.search;
 var x=new Date(_udt.getTime()+(_ucto*1000));
 var dc=_ubd.cookie;
 x=" expires="+x.toGMTString()+";";
 if (_ulink && !_ubl) {
  z=_uUES(_uGC(s,"__utmz=","&"));
  if (z!="-" && z.indexOf(";")==-1) { _ubd.cookie="__utmz="+z+"; path="+_utcp+";"+x+_udo; return ""; }
 }
 z=dc.indexOf("__utmz="+_udh+".");
 if (z>-1) { z=_uGC(dc,"__utmz="+_udh+".",";"); }
 else { z="-"; }
 t=_uGC(s,_ucid+"=","&");
 t2=_uGC(s,_ucsr+"=","&");
 t3=_uGC(s,"gclid=","&");
 if ((t!="-" && t!="") || (t2!="-" && t2!="") || (t3!="-" && t3!="")) {
  if (t!="-" && t!="") c+="utmcid="+_uEC(t);
  if (t2!="-" && t2!="") { if (c != "") c+="|"; c+="utmcsr="+_uEC(t2); }
  if (t3!="-" && t3!="") { if (c != "") c+="|"; c+="utmgclid="+_uEC(t3); }
  t=_uGC(s,_uccn+"=","&");
  if (t!="-" && t!="") c+="|utmccn="+_uEC(t);
  else c+="|utmccn=(not+set)";
  t=_uGC(s,_ucmd+"=","&");
  if (t!="-" && t!="") c+="|utmcmd="+_uEC(t);
  else  c+="|utmcmd=(not+set)";
  t=_uGC(s,_uctr+"=","&");
  if (t!="-" && t!="") c+="|utmctr="+_uEC(t);
  else { t=_uOrg(1); if (t!="-" && t!="") c+="|utmctr="+_uEC(t); }
  t=_uGC(s,_ucct+"=","&");
  if (t!="-" && t!="") c+="|utmcct="+_uEC(t);
  t=_uGC(s,_ucno+"=","&");
  if (t=="1") o=1;
  if (z!="-" && o==1) return "";
 }
 if (c=="-" || c=="") { c=_uOrg(); if (z!="-" && _ufno==1)  return ""; }
 if (c=="-" || c=="") { if (_ufns==1)  c=_uRef(); if (z!="-" && _ufno==1)  return ""; }
 if (c=="-" || c=="") {
  if (z=="-" && _ufns==1) { c="utmccn=(direct)|utmcsr=(direct)|utmcmd=(none)"; }
  if (c=="-" || c=="") return "";
 }
 if (z!="-") {
  i=z.indexOf(".");
  if (i>-1) i=z.indexOf(".",i+1);
  if (i>-1) i=z.indexOf(".",i+1);
  if (i>-1) i=z.indexOf(".",i+1);
  t=z.substring(i+1,z.length);
  if (t.toLowerCase()==c.toLowerCase()) cs=1;
  t=z.substring(0,i);
  if ((i=t.lastIndexOf(".")) > -1) {
   t=t.substring(i+1,t.length);
   cn=(t*1);
  }
 }
 if (cs==0 || _ufns==1) {
  t=_uGC(dc,"__utma="+_udh+".",";");
  if ((i=t.lastIndexOf(".")) > 9) {
   _uns=t.substring(i+1,t.length);
   _uns=(_uns*1);
  }
  cn++;
  if (_uns==0) _uns=1;
  _ubd.cookie="__utmz="+_udh+"."+_ust+"."+_uns+"."+cn+"."+c+"; path="+_utcp+"; "+x+_udo;
 }
 if (cs==0 || _ufns==1) return "&utmcn=1";
 else return "&utmcr=1";
}
function _uRef() {
 if (_ur=="0" || _ur=="" || _ur=="-") return "";
 var i=0,h,k,n;
 if ((i=_ur.indexOf("://"))<0 || _uGCse()) return "";
 h=_ur.substring(i+3,_ur.length);
 if (h.indexOf("/") > -1) {
  k=h.substring(h.indexOf("/"),h.length);
  if (k.indexOf("?") > -1) k=k.substring(0,k.indexOf("?"));
  h=h.substring(0,h.indexOf("/"));
 }
 h=h.toLowerCase();
 n=h;
 if ((i=n.indexOf(":")) > -1) n=n.substring(0,i);
 for (var ii=0;ii<_uRno.length;ii++) {
  if ((i=n.indexOf(_uRno[ii].toLowerCase())) > -1 && n.length==(i+_uRno[ii].length)) { _ufno=1; break; }
 }
 if (h.indexOf("www.")==0) h=h.substring(4,h.length);
 return "utmccn=(referral)|utmcsr="+_uEC(h)+"|"+"utmcct="+_uEC(k)+"|utmcmd=referral";
}
function _uOrg(t) {
 if (_ur=="0" || _ur=="" || _ur=="-") return "";
 var i=0,h,k;
 if ((i=_ur.indexOf("://"))<0 || _uGCse()) return "";
 h=_ur.substring(i+3,_ur.length);
 if (h.indexOf("/") > -1) {
  h=h.substring(0,h.indexOf("/"));
 }
 for (var ii=0;ii<_uOsr.length;ii++) {
  if (h.toLowerCase().indexOf(_uOsr[ii].toLowerCase()) > -1) {
   if ((i=_ur.indexOf("?"+_uOkw[ii]+"=")) > -1 || (i=_ur.indexOf("&"+_uOkw[ii]+"=")) > -1) {
    k=_ur.substring(i+_uOkw[ii].length+2,_ur.length);
    if ((i=k.indexOf("&")) > -1) k=k.substring(0,i);
    for (var yy=0;yy<_uOno.length;yy++) {
     if (_uOno[yy].toLowerCase()==k.toLowerCase()) { _ufno=1; break; }
    }
    if (t) return _uEC(k);
    else return "utmccn=(organic)|utmcsr="+_uEC(_uOsr[ii])+"|"+"utmctr="+_uEC(k)+"|utmcmd=organic";
   }
  }
 }
 return "";
}
function _uGCse() {
 var h,p;
 h=p=_ur.split("://")[1];
 if(h.indexOf("/")>-1) {
  h=h.split("/")[0];
  p=p.substring(p.indexOf("/")+1,p.length);
 }
 if(p.indexOf("?")>-1) {
  p=p.split("?")[0];
 }
 if(h.toLowerCase().indexOf("google")>-1) {
  if(_ur.indexOf("?q=")>-1 || _ur.indexOf("&q=")>-1) {
   if (p.toLowerCase().indexOf("cse")>-1) {
    return true;
   }
  }
 }
}
function _uBInfo() {
 var sr="-",sc="-",ul="-",fl="-",cs="-",je=1;
 var n=navigator;
 if (self.screen) {
  sr=screen.width+"x"+screen.height;
  sc=screen.colorDepth+"-bit";
 } else if (self.java) {
  var j=java.awt.Toolkit.getDefaultToolkit();
  var s=j.getScreenSize();
  sr=s.width+"x"+s.height;
 }
 if (n.language) { ul=n.language.toLowerCase(); }
 else if (n.browserLanguage) { ul=n.browserLanguage.toLowerCase(); }
 je=n.javaEnabled()?1:0;
 if (_uflash) fl=_uFlash();
 if (_ubd.characterSet) cs=_uES(_ubd.characterSet);
 else if (_ubd.charset) cs=_uES(_ubd.charset);
 return "&utmcs="+cs+"&utmsr="+sr+"&utmsc="+sc+"&utmul="+ul+"&utmje="+je+"&utmfl="+fl;
}
function __utmSetTrans() {
 var e;
 if (_ubd.getElementById) e=_ubd.getElementById("utmtrans");
 else if (_ubd.utmform && _ubd.utmform.utmtrans) e=_ubd.utmform.utmtrans;
 if (!e) return;
 var l=e.value.split("UTM:");
 var i,i2,c;
 if (_userv==0 || _userv==2) i=new Array();
 if (_userv==1 || _userv==2) { i2=new Array(); c=_uGCS(); }

 for (var ii=0;ii<l.length;ii++) {
  l[ii]=_uTrim(l[ii]);
  if (l[ii].charAt(0)!='T' && l[ii].charAt(0)!='I') continue;

  var r=Math.round(Math.random()*2147483647);
  if (!_utsp || _utsp=="") _utsp="|";
  var f=l[ii].split(_utsp),s="";
  if (f[0].charAt(0)=='T') {
   s="&utmt=tran"+"&utmn="+r;
   f[1]=_uTrim(f[1]); if(f[1]&&f[1]!="") s+="&utmtid="+_uES(f[1]);
   f[2]=_uTrim(f[2]); if(f[2]&&f[2]!="") s+="&utmtst="+_uES(f[2]);
   f[3]=_uTrim(f[3]); if(f[3]&&f[3]!="") s+="&utmtto="+_uES(f[3]);
   f[4]=_uTrim(f[4]); if(f[4]&&f[4]!="") s+="&utmttx="+_uES(f[4]);
   f[5]=_uTrim(f[5]); if(f[5]&&f[5]!="") s+="&utmtsp="+_uES(f[5]);
   f[6]=_uTrim(f[6]); if(f[6]&&f[6]!="") s+="&utmtci="+_uES(f[6]);
   f[7]=_uTrim(f[7]); if(f[7]&&f[7]!="") s+="&utmtrg="+_uES(f[7]);
   f[8]=_uTrim(f[8]); if(f[8]&&f[8]!="") s+="&utmtco="+_uES(f[8]);
  } else {
   s="&utmt=item"+"&utmn="+r;
   f[1]=_uTrim(f[1]); if(f[1]&&f[1]!="") s+="&utmtid="+_uES(f[1]);
   f[2]=_uTrim(f[2]); if(f[2]&&f[2]!="") s+="&utmipc="+_uES(f[2]);
   f[3]=_uTrim(f[3]); if(f[3]&&f[3]!="") s+="&utmipn="+_uES(f[3]);
   f[4]=_uTrim(f[4]); if(f[4]&&f[4]!="") s+="&utmiva="+_uES(f[4]);
   f[5]=_uTrim(f[5]); if(f[5]&&f[5]!="") s+="&utmipr="+_uES(f[5]);
   f[6]=_uTrim(f[6]); if(f[6]&&f[6]!="") s+="&utmiqt="+_uES(f[6]);
  }
  if (_udl.hostname && _udl.hostname!="") s+="&utmhn="+_uES(_udl.hostname);
  if (_usample && _usample != 100) s+="&utmsp="+_uES(_usample);

  if ((_userv==0 || _userv==2) && _uSP()) {
   i[ii]=new Image(1,1);
   i[ii].src=_ugifpath+"?"+"utmwv="+_uwv+s;
   i[ii].onload=function() { _uVoid(); }
  }
  if ((_userv==1 || _userv==2) && _uSP()) {
   i2[ii]=new Image(1,1);
   i2[ii].src=_ugifpath2+"?"+"utmwv="+_uwv+s+"&utmac="+_uacct+"&utmcc="+c;
   i2[ii].onload=function() { _uVoid(); }
  }
 }
 return;
}
function _uFlash() {
 var f="-",n=navigator;
 if (n.plugins && n.plugins.length) {
  for (var ii=0;ii<n.plugins.length;ii++) {
   if (n.plugins[ii].name.indexOf('Shockwave Flash')!=-1) {
    f=n.plugins[ii].description.split('Shockwave Flash ')[1];
    break;
   }
  }
 } else {
  var fl;
  try {
   fl = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
   f = fl.GetVariable("$version");
  } catch(e) {}
  if (f == "-") {
   try {
    fl = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
    f = "WIN 6,0,21,0";
    fl.AllowScriptAccess = "always";
    f = fl.GetVariable("$version");
   } catch(e) {}
  }
  if (f == "-") {
   try {
    fl = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
    f = fl.GetVariable("$version");
   } catch(e) {}
  }
  if (f != "-") {
   f = f.split(" ")[1].split(",");
   f = f[0] + "." + f[1] + " r" + f[2];
  }
 }
 return f;
}
function __utmLinkerUrl(l,h) {
 var p,k,a="-",b="-",c="-",x="-",z="-",v="-";
 var dc=_ubd.cookie;
 var iq = l.indexOf("?");
 var ih = l.indexOf("#");
 var url=l;
 if (dc) {
  a=_uES(_uGC(dc,"__utma="+_udh+".",";"));
  b=_uES(_uGC(dc,"__utmb="+_udh,";"));
  c=_uES(_uGC(dc,"__utmc="+_udh,";"));
  x=_uES(_uGC(dc,"__utmx="+_udh,";"));
  z=_uES(_uGC(dc,"__utmz="+_udh+".",";"));
  v=_uES(_uGC(dc,"__utmv="+_udh+".",";"));
  k=(_uHash(a+b+c+x+z+v)*1)+(_udh*1);
  p="__utma="+a+"&__utmb="+b+"&__utmc="+c+"&__utmx="+x+"&__utmz="+z+"&__utmv="+v+"&__utmk="+k;
 }
 if (p) {
  if (h && ih>-1) return;
  if (h) { url=l+"#"+p; }
  else {
   if (iq==-1 && ih==-1) url=l+"?"+p;
   else if (ih==-1) url=l+"&"+p;
   else if (iq==-1) url=l.substring(0,ih-1)+"?"+p+l.substring(ih);
   else url=l.substring(0,ih-1)+"&"+p+l.substring(ih);
  }
 }
 return url;
}
function __utmLinker(l,h) {
 if (!_ulink || !l || l=="") return;
 _udl.href=__utmLinkerUrl(l,h);
}
function __utmLinkPost(f,h) {
 if (!_ulink || !f || !f.action) return;
 f.action=__utmLinkerUrl(f.action, h);
 return;
}
function __utmSetVar(v) {
 if (!v || v=="") return;
 if (!_udo || _udo == "") {
  _udh=_uDomain();
  if (_udn && _udn!="") { _udo=" domain="+_udn+";"; }
 }
 if (!_uVG()) return;
 var r=Math.round(Math.random() * 2147483647);
 _ubd.cookie="__utmv="+_udh+"."+_uES(v)+"; path="+_utcp+"; expires="+_uNx()+";"+_udo;
 var s="&utmt=var&utmn="+r;
 if (_usample && _usample != 100) s+="&utmsp="+_uES(_usample);
 if ((_userv==0 || _userv==2) && _uSP()) {
  var i=new Image(1,1);
  i.src=_ugifpath+"?"+"utmwv="+_uwv+s;
  i.onload=function() { _uVoid(); }
 }
 if ((_userv==1 || _userv==2) && _uSP()) {
  var i2=new Image(1,1);
  i2.src=_ugifpath2+"?"+"utmwv="+_uwv+s+"&utmac="+_uacct+"&utmcc="+_uGCS();
  i2.onload=function() { _uVoid(); }
 }
}
function _uGCS() {
 var t,c="",dc=_ubd.cookie;
 if ((t=_uGC(dc,"__utma="+_udh+".",";"))!="-") c+=_uES("__utma="+t+";+");
 if ((t=_uGC(dc,"__utmx="+_udh,";"))!="-") c+=_uES("__utmx="+t+";+");
 if ((t=_uGC(dc,"__utmz="+_udh+".",";"))!="-") c+=_uES("__utmz="+t+";+");
 if ((t=_uGC(dc,"__utmv="+_udh+".",";"))!="-") c+=_uES("__utmv="+t+";");
 if (c.charAt(c.length-1)=="+") c=c.substring(0,c.length-1);
 return c;
}
function _uGC(l,n,s) {
 if (!l || l=="" || !n || n=="" || !s || s=="") return "-";
 var i,i2,i3,c="-";
 i=l.indexOf(n);
 i3=n.indexOf("=")+1;
 if (i > -1) {
  i2=l.indexOf(s,i); if (i2 < 0) { i2=l.length; }
  c=l.substring((i+i3),i2);
 }
 return c;
}
function _uDomain() {
 if (!_udn || _udn=="" || _udn=="none") { _udn=""; return 1; }
 if (_udn=="auto") {
  var d=_ubd.domain;
  if (d.substring(0,4)=="www.") {
   d=d.substring(4,d.length);
  }
  _udn=d;
 }
 _udn = _udn.toLowerCase(); 
 if (_uhash=="off") return 1;
 return _uHash(_udn);
}
function _uHash(d) {
 if (!d || d=="") return 1;
 var h=0,g=0;
 for (var i=d.length-1;i>=0;i--) {
  var c=parseInt(d.charCodeAt(i));
  h=((h << 6) & 0xfffffff) + c + (c << 14);
  if ((g=h & 0xfe00000)!=0) h=(h ^ (g >> 21));
 }
 return h;
}
function _uFixA(c,s,t) {
 if (!c || c=="" || !s || s=="" || !t || t=="") return "-";
 var a=_uGC(c,"__utma="+_udh+".",s);
 var lt=0,i=0;
 if ((i=a.lastIndexOf(".")) > 9) {
  _uns=a.substring(i+1,a.length);
  _uns=(_uns*1)+1;
  a=a.substring(0,i);
  if ((i=a.lastIndexOf(".")) > 7) {
   lt=a.substring(i+1,a.length);
   a=a.substring(0,i);
  }
  if ((i=a.lastIndexOf(".")) > 5) {
   a=a.substring(0,i);
  }
  a+="."+lt+"."+t+"."+_uns;
 }
 return a;
}
function _uTrim(s) {
  if (!s || s=="") return "";
  while ((s.charAt(0)==' ') || (s.charAt(0)=='\n') || (s.charAt(0,1)=='\r')) s=s.substring(1,s.length);
  while ((s.charAt(s.length-1)==' ') || (s.charAt(s.length-1)=='\n') || (s.charAt(s.length-1)=='\r')) s=s.substring(0,s.length-1);
  return s;
}
function _uEC(s) {
  var n="";
  if (!s || s=="") return "";
  for (var i=0;i<s.length;i++) {if (s.charAt(i)==" ") n+="+"; else n+=s.charAt(i);}
  return n;
}
function __utmVisitorCode(f) {
 var r=0,t=0,i=0,i2=0,m=31;
 var a=_uGC(_ubd.cookie,"__utma="+_udh+".",";");
 if ((i=a.indexOf(".",0))<0) return;
 if ((i2=a.indexOf(".",i+1))>0) r=a.substring(i+1,i2); else return "";  
 if ((i=a.indexOf(".",i2+1))>0) t=a.substring(i2+1,i); else return "";  
 if (f) {
  return r;
 } else {
  var c=new Array('A','B','C','D','E','F','G','H','J','K','L','M','N','P','R','S','T','U','V','W','X','Y','Z','1','2','3','4','5','6','7','8','9');
  return c[r>>28&m]+c[r>>23&m]+c[r>>18&m]+c[r>>13&m]+"-"+c[r>>8&m]+c[r>>3&m]+c[((r&7)<<2)+(t>>30&3)]+c[t>>25&m]+c[t>>20&m]+"-"+c[t>>15&m]+c[t>>10&m]+c[t>>5&m]+c[t&m];
 }
}
function _uIN(n) {
 if (!n) return false;
 for (var i=0;i<n.length;i++) {
  var c=n.charAt(i);
  if ((c<"0" || c>"9") && (c!=".")) return false;
 }
 return true;
}
function _uES(s,u) {
 if (typeof(encodeURIComponent) == 'function') {
  if (u) return encodeURI(s);
  else return encodeURIComponent(s);
 } else {
  return escape(s);
 }
}
function _uUES(s) {
 if (typeof(decodeURIComponent) == 'function') {
  return decodeURIComponent(s);
 } else {
  return unescape(s);
 }
}
function _uVG() {
 if((_udn.indexOf("www.google.") == 0 || _udn.indexOf(".google.") == 0 || _udn.indexOf("google.") == 0) && _utcp=='/' && _udn.indexOf("google.org")==-1) {
  return false;
 }
 return true;
}
function _uSP() {
 var s=100;
 if (_usample) s=_usample;
 if(s>=100 || s<=0) return true;
 return ((__utmVisitorCode(1)%10000)<(s*100));
}
function urchinPathCopy(p){
 var d=document,nx,tx,sx,i,c,cs,t,h,o;
 cs=new Array("a","b","c","v","x","z");
 h=_uDomain(); if (_udn && _udn!="") o=" domain="+_udn+";";
 nx=_uNx()+";";
 tx=new Date(); tx.setTime(tx.getTime()+(_utimeout*1000));
 tx=tx.toGMTString()+";";
 sx=new Date(); sx.setTime(sx.getTime()+(_ucto*1000));
 sx=sx.toGMTString()+";";
 for (i=0;i<6;i++){
  t=" expires=";
  if (i==1) t+=tx; else if (i==2) t=""; else if (i==5) t+=sx; else t+=nx;
  c=_uGC(d.cookie,"__utm"+cs[i]+"="+h,";");
  if (c!="-") d.cookie="__utm"+cs[i]+"="+c+"; path="+p+";"+t+o;
 }
}
function _uCO() {
 if (!_utk || _utk=="" || _utk.length<10) return;
 var d='www.google.com';
 if (_utk.charAt(0)=='!') d='analytics.corp.google.com';
 _ubd.cookie="GASO="+_utk+"; path="+_utcp+";"+_udo;
 var sc=document.createElement('script');
 sc.type='text/javascript';
 sc.id="_gasojs";
 sc.src='https://'+d+'/analytics/reporting/overlay_js?gaso='+_utk+'&'+Math.random();
 document.getElementsByTagName('head')[0].appendChild(sc);  
}
function _uGT() {
 var h=location.hash, a;
 if (h && h!="" && h.indexOf("#gaso=")==0) {
  a=_uGC(h,"gaso=","&");
 } else {
  a=_uGC(_ubd.cookie,"GASO=",";");
 }
 return a;
}
var _utk=_uGT();
if (_utk && _utk!="" && _utk.length>10 && _utk.indexOf("=")==-1) {
 if (window.addEventListener) {
  window.addEventListener('load', _uCO, false); 
 } else if (window.attachEvent) { 
  window.attachEvent('onload', _uCO);
 }
}

function _uNx() {
  return (new Date((new Date()).getTime()+63072000000)).toGMTString();
}
/*------------ urchin.js ------------------*/

/*------------ script.js ------------------*/
var menu=function(){
	var t=25,z=99,s=2.5,a;
	function dd(n){this.n=n; this.h=[]; this.c=[]}
	dd.prototype.init=function(p,c){
		a=c; var w=document.getElementById(p), s=w.getElementsByTagName('ul'), l=s.length, i=0;
		for(i;i<l;i++){
			var h=s[i].parentNode; this.h[i]=h; this.c[i]=s[i];
			h.onmouseover=new Function(this.n+'.st('+i+',true)');
			h.onmouseout=new Function(this.n+'.st('+i+')');
		}
	}
	dd.prototype.st=function(x,f){
		var c=this.c[x], h=this.h[x], p=h.getElementsByTagName('a')[0];
		clearInterval(c.t); c.style.overflow='hidden';
		if(f){
			p.className+=' '+a;
			if(!c.mh){c.style.display='block'; c.style.height=''; c.mh=c.offsetHeight; c.style.height=0}
			if(c.mh==c.offsetHeight){c.style.overflow='visible'}
			else{c.style.zIndex=z; z++; c.t=setInterval(function(){sl(c,1)},t)}
		}else{p.className=p.className.replace(a,''); c.t=setInterval(function(){sl(c,-1)},t)}
	}
	function sl(c,f){
		var h=c.offsetHeight;
		if((h<=0&&f!=1)||(h>=c.mh&&f==1)){
			if(f==1){c.style.filter=''; c.style.opacity=1; c.style.overflow='visible'}
			clearInterval(c.t); return
		}
		var d=(f==1)?Math.ceil((c.mh-h)/s):Math.ceil(h/s), o=h/c.mh;
		c.style.opacity=o; c.style.filter='alpha(opacity='+(o*100)+')';
		c.style.height=h+(d*f)+'px'
	}
	return{dd:dd}
}();

/*$(document).ready(function() {
						   
	$("#editoArro").click(function(event) {
			event.preventDefault();
			$("#editoBox").slideToggle();
			$("#editoArro").addClass("active");
	});
	
	$("#btn_close").click(function(event) {
		event.preventDefault();
		$("#editoBox").slideToggle();
		$("#editoArro").removeClass("active");
		editoState = false;
	});
	$("#editoLnk").mouseover(function(event) {
			$("#editoArro").addClass("active");
	});
	$("#editoLnk").mouseout(function(event) {
			if($("#editoBox").css("display")== "none"){				 
			$("#editoArro").removeClass("active");
			}
	});
 });*/
/*------------ script.js ------------------*/

/*------------ companyprofilenav.js -----------*/
/**
 * Home Module JS Files
 * @author Pathfinder Solutions India
 * @link http://www.pathfindersolutions.biz
 * @version 1.0
 * @package justmeans
 * @subpackage home 
 */

 function fnSetUnsetCompanyprofileMenu(strShowMenu,strHideMenu)
	{
		//document.getElementById('id_'+strShowMenu).style.display="";
		document.getElementById('id_'+strShowMenu).className="selected";
		document.getElementById('id_'+strShowMenu+'ul').style.display="";
		
		arrHideMenus = new Array();
		arrHideMenus = strHideMenu.split(",");
		
		for(var i=0; i<arrHideMenus.length; i++)
		{
			//document.getElementById('id_'+arrHideMenus[i]).style.display="none";
			document.getElementById('id_'+arrHideMenus[i]).className="";
			document.getElementById('id_'+arrHideMenus[i]+'ul').style.display="none";
		}
	}
/*------------ companyprofilenav.js -----------*/

function fnProcessPagination(strProcessDiv, intLimit, intPageNo, strParameters)
{
	document.getElementById(strProcessDiv).innerHTML = "<img src='images/loading.gif' />";
	ajaxObjects[0] = new sack();
	ajaxObjects[0].requestFile = sitename+"/index.php?action="+strParameters+"&page="+intPageNo;
	ajaxObjects[0].onCompletion = function(){ 														
												document.getElementById(strProcessDiv).innerHTML = ajaxObjects[0].response;
											};
	ajaxObjects[0].runAJAX();

	return false;
}


/*FOR NEW CHANGE IN SHOW HIDE DESCRIPTION*/	
/*FUNCTION TO SET GLOBLE SHOW /HIDE DISCRIPTION*/
function fnHideShowGlobalDesc(strPagetitle)
{
	var strDiscriptionStyle = document.getElementById("id_DisplayDesc").value;

	document.getElementById("id_Show_Link").style.display = "none";
	document.getElementById("id_Global_Description").style.display = "none";
	document.getElementById("id_Hide_Link").style.display = "none";
	document.getElementById("id_Loading").style.display = "";
	
	if(strDiscriptionStyle == 'y')
	{
		var strIsShowHide = 'n';
	}
	else
	{
		 var strIsShowHide = 'y';
	}

	ajaxObjects[1] = new sack();
	ajaxObjects[1].requestFile = sitename+"/index.php?action=accessrights&mode=ajax&ajax_action=fnsetShowHideGlobalDesc&pagetitle="+strPagetitle+"&showhidedes="+strIsShowHide;
	ajaxObjects[1].onCompletion = function(){
												document.getElementById("id_Loading").style.display = "none";
												document.getElementById("id_DisplayDesc").value = strIsShowHide;
												if (strIsShowHide == 'n')
												{
													document.getElementById("id_Show_Link").style.display = "";
												}
												else
												{
													document.getElementById("id_Hide_Link").style.display = "";
													document.getElementById("id_Global_Description").style.display = "";
												}
											 	//alert(ajaxObjects[1].response);
											};
	ajaxObjects[1].runAJAX();
}




/*FUNCTION TO SET GLOBLE SHOW /HIDE DISCRIPTION*/
/*function fnHideShowGlobalDesc(stringcond)
{
	if(stringcond=='import')
	{
		var isDisp = document.getElementById('id_global_import_desc').style.display;
		if(isDisp=='none')
		{
			document.getElementById('id_global_import_desc').style.display='';
			document.getElementById('id_importglobaldesc').src='images/arrow_down.gif';
			document.getElementById('id_importdesclabel').innerHTML='Hide Help';
			document.getElementById('id_desc_seperator').innerHTML='<div class="thinseperator" style="width:115%;"></div>';
		}
		else
		{
			document.getElementById('id_global_import_desc').style.display='none';
			document.getElementById('id_importglobaldesc').src='images/arrow_right.gif';
			document.getElementById('id_importdesclabel').innerHTML='Show Help';
			document.getElementById('id_desc_seperator').innerHTML='';
		}
	}
	else if(stringcond=='accessrights')
	{
		var isDisp = document.getElementById('id_global_accessrights_desc').style.display;
		if(isDisp=='none')
		{
			document.getElementById('id_global_accessrights_desc').style.display='';
			document.getElementById('id_accessrightsglobaldesc').src='images/arrow_down.gif';
			document.getElementById('id_accessrightsdesclabel').innerHTML='Hide Help';
			document.getElementById('id_desc_seperator').innerHTML='<div class="thinseperator" style="width:115%;"></div>';
			
			
			
		}
		else
		{
			document.getElementById('id_global_accessrights_desc').style.display='none';
			document.getElementById('id_accessrightsglobaldesc').src='images/arrow_right.gif';
			document.getElementById('id_accessrightsdesclabel').innerHTML='Show Help';
			document.getElementById('id_desc_seperator').innerHTML='';
			
		}
	}
	else if(stringcond=='synd')
	{
		var isDisp = document.getElementById('id_global_synd_desc').style.display;
		if(isDisp=='none')
		{
			document.getElementById('id_global_synd_desc').style.display='';
			document.getElementById('id_syndglobaldesc').src='images/arrow_down.gif';
			document.getElementById('id_synddesclabel').innerHTML='Hide Help';
			document.getElementById('id_desc_seperator').innerHTML='<div class="thinseperator" style="width:115%;"></div>';
		}
		else
		{
			document.getElementById('id_global_synd_desc').style.display='none';
			document.getElementById('id_syndglobaldesc').src='images/arrow_right.gif';
			document.getElementById('id_synddesclabel').innerHTML='Show Help';
			document.getElementById('id_desc_seperator').innerHTML='';
		}
	}
	else if(stringcond=='contest')
	{
		var isDisp = document.getElementById('id_global_contest_desc').style.display;
		if(isDisp=='none')
		{
			document.getElementById('id_global_contest_desc').style.display='';
			document.getElementById('id_contestglobaldesc').src='images/arrow_down.gif';
			document.getElementById('id_contestdesclabel').innerHTML='Hide Help';
			document.getElementById('id_desc_seperator').innerHTML='<div class="thinseperator" style="width:115%;"></div>';
		}
		else
		{
			document.getElementById('id_global_contest_desc').style.display='none';
			document.getElementById('id_contestglobaldesc').src='images/arrow_right.gif';
			document.getElementById('id_contestdesclabel').innerHTML='Show Help';
			document.getElementById('id_desc_seperator').innerHTML='';
		}
	}
	else if(stringcond=='events')
	{
		var isDisp = document.getElementById('id_global_events_desc').style.display;
		if(isDisp=='none')
		{
			document.getElementById('id_global_events_desc').style.display='';
			document.getElementById('id_eventsglobaldesc').src='images/arrow_down.gif';
			document.getElementById('id_eventsdesclabel').innerHTML='Hide Help';
			document.getElementById('id_desc_seperator').innerHTML='<div class="thinseperator" style="width:115%;"></div>';
		}
		else
		{
			document.getElementById('id_global_events_desc').style.display='none';
			document.getElementById('id_eventsglobaldesc').src='images/arrow_right.gif';
			document.getElementById('id_eventsdesclabel').innerHTML='Show Help';
			document.getElementById('id_desc_seperator').innerHTML='';
		}
	}
	else if(stringcond=='metrics')
	{
		var isDisp = document.getElementById('id_global_metrics_desc').style.display;
		if(isDisp=='none')
		{
			document.getElementById('id_global_metrics_desc').style.display='';
			document.getElementById('id_metricsglobaldesc').src='images/arrow_down.gif';
			document.getElementById('id_metricsdesclabel').innerHTML='Hide Help';
			document.getElementById('id_desc_seperator').innerHTML='<div class="thinseperator" style="width:115%;"></div>';
		}
		else
		{
			document.getElementById('id_global_metrics_desc').style.display='none';
			document.getElementById('id_metricsglobaldesc').src='images/arrow_right.gif';
			document.getElementById('id_metricsdesclabel').innerHTML='Show Help';
			document.getElementById('id_desc_seperator').innerHTML='';
		}
	}
	else if(stringcond=='jobs')
	{
		var isDisp = document.getElementById('id_global_jobs_desc').style.display;
		if(isDisp=='none')
		{
			document.getElementById('id_global_jobs_desc').style.display='';
			document.getElementById('id_jobsglobaldesc').src='images/arrow_down.gif';
			document.getElementById('id_jobsdesclabel').innerHTML='Hide Help';
			document.getElementById('id_desc_seperator').innerHTML='<div class="thinseperator" style="width:115%;"></div>';
		}
		else
		{
			document.getElementById('id_global_jobs_desc').style.display='none';
			document.getElementById('id_jobsglobaldesc').src='images/arrow_right.gif';
			document.getElementById('id_jobsdesclabel').innerHTML='Show Help';
			document.getElementById('id_desc_seperator').innerHTML='';
		}
	}
	else if(stringcond=='comprofile')
	{
		var isDisp = document.getElementById('id_global_comprofile_desc').style.display;
		if(isDisp=='none')
		{
			document.getElementById('id_global_comprofile_desc').style.display='';
			document.getElementById('id_comprofileglobaldesc').src='images/arrow_down.gif';
			document.getElementById('id_comprofiledesclabel').innerHTML='Hide Help';
			document.getElementById('id_desc_seperator').innerHTML='<div class="thinseperator" style="width:115%;"></div>';
		}
		else
		{
			document.getElementById('id_global_comprofile_desc').style.display='none';
			document.getElementById('id_comprofileglobaldesc').src='images/arrow_right.gif';
			document.getElementById('id_comprofiledesclabel').innerHTML='Show Help';
			document.getElementById('id_desc_seperator').innerHTML='';
		}
	}
	else if(stringcond=='mrel')
	{
		var isDisp = document.getElementById('id_global_mrel_desc').style.display;
		if(isDisp=='none')
		{
			document.getElementById('id_global_mrel_desc').style.display='';
			document.getElementById('id_mrelglobaldesc').src='images/arrow_down.gif';
			document.getElementById('id_mreldesclabel').innerHTML='Hide Help';
			document.getElementById('id_desc_seperator').innerHTML='<div class="thinseperator" style="width:115%;"></div>';
		}
		else
		{
			document.getElementById('id_global_mrel_desc').style.display='none';
			document.getElementById('id_mrelglobaldesc').src='images/arrow_right.gif';
			document.getElementById('id_mreldesclabel').innerHTML='Show Help';
			document.getElementById('id_desc_seperator').innerHTML='';
		}
	}

	else if(stringcond=='comments')
	{
		var isDisp = document.getElementById('id_global_comments_desc').style.display;
		if(isDisp=='none')
		{
			document.getElementById('id_global_comments_desc').style.display='';
			document.getElementById('id_commentsglobaldesc').src='images/arrow_down.gif';
			document.getElementById('id_commentsdesclabel').innerHTML='Hide Help';
			document.getElementById('id_desc_seperator').innerHTML='<div class="thinseperator" style="width:115%;"></div>';
		}
		else
		{
			document.getElementById('id_global_comments_desc').style.display='none';
			document.getElementById('id_commentsglobaldesc').src='images/arrow_right.gif';
			document.getElementById('id_commentsdesclabel').innerHTML='Show Help';
			document.getElementById('id_desc_seperator').innerHTML='';
		}
	}
	
	
}*/

/*------------ jcarousellite_1.0.1.js -----------*/
/*FOR HOME PAGE WEB CLIPS NAVIGATION*/
(function($) {                                          // Compliant with jquery.noConflict()
$.fn.jCarouselLite = function(o) {
    o = $.extend({
        btnPrev: null,
        btnNext: null,
        btnGo: null,
        mouseWheel: false,
        auto: null,

        speed: 200,
        easing: null,

        vertical: false,
        circular: true,
        visible: 1,
        start: 0,
        scroll: 1,

        beforeStart: null,
        afterEnd: null
    }, o || {});

    return this.each(function() {                           // Returns the element collection. Chainable.

        var running = false, animCss=o.vertical?"top":"left", sizeCss=o.vertical?"height":"width";
        var div = $(this), ul = $("ul", div), tLi = $("li", ul), tl = tLi.size(), v = o.visible;

        if(o.circular) {
            ul.prepend(tLi.slice(tl-v-1+1).clone())
              .append(tLi.slice(0,v).clone());
            o.start += v;
        }

        var li = $("li", ul), itemLength = li.size(), curr = o.start;
        div.css("visibility", "visible");

        li.css({overflow: "hidden", float: o.vertical ? "none" : "left"});
        ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"});
        div.css({overflow: "hidden", position: "relative", "z-index": "2", left: "0px"});

        var liSize = o.vertical ? height(li) : width(li);   // Full li size(incl margin)-Used for animation
        var ulSize = liSize * itemLength;                   // size of full ul(total length, not just for the visible items)
        var divSize = liSize * v;                           // size of entire div(total length for just the visible items)

        li.css({width: li.width(), height: li.height()});
        ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize));

        div.css(sizeCss, divSize+"px");                     // Width of the DIV. length of visible images

        if(o.btnPrev)
            $(o.btnPrev).click(function() {
                return go(curr-o.scroll);
            });

        if(o.btnNext)
            $(o.btnNext).click(function() {
                return go(curr+o.scroll);
            });

        if(o.btnGo)
            $.each(o.btnGo, function(i, val) {
                $(val).click(function() {
                    return go(o.circular ? o.visible+i : i);
                });
            });

        if(o.mouseWheel && div.mousewheel)
            div.mousewheel(function(e, d) {
                return d>0 ? go(curr-o.scroll) : go(curr+o.scroll);
            });

        if(o.auto)
            setInterval(function() {
                go(curr+o.scroll);
            }, o.auto+o.speed);

        function vis() {
            return li.slice(curr).slice(0,v);
        };

        function go(to) {
            if(!running) {

                if(o.beforeStart)
                    o.beforeStart.call(this, vis());

                if(o.circular) {            // If circular we are in first or last, then goto the other end
                    if(to<=o.start-v-1) {           // If first, then goto last
                        ul.css(animCss, -((itemLength-(v*2))*liSize)+"px");
                        // If "scroll" > 1, then the "to" might not be equal to the condition; it can be lesser depending on the number of elements.
                        curr = to==o.start-v-1 ? itemLength-(v*2)-1 : itemLength-(v*2)-o.scroll;
                    } else if(to>=itemLength-v+1) { // If last, then goto first
                        ul.css(animCss, -( (v) * liSize ) + "px" );
                        // If "scroll" > 1, then the "to" might not be equal to the condition; it can be greater depending on the number of elements.
                        curr = to==itemLength-v+1 ? v+1 : v+o.scroll;
                    } else curr = to;
                } else {                    // If non-circular and to points to first or last, we just return.
                    if(to<0 || to>itemLength-v) return;
                    else curr = to;
                }                           // If neither overrides it, the curr will still be "to" and we can proceed.

                running = true;

                ul.animate(
                    animCss == "left" ? { left: -(curr*liSize) } : { top: -(curr*liSize) } , o.speed, o.easing,
                    function() {
                        if(o.afterEnd)
                            o.afterEnd.call(this, vis());
                        running = false;
                    }
                );
                // Disable buttons when the carousel reaches the last/first, and enable when not
                if(!o.circular) {
                    $(o.btnPrev + "," + o.btnNext).removeClass("disabled");
                    $( (curr-o.scroll<0 && o.btnPrev)
                        ||
                       (curr+o.scroll > itemLength-v && o.btnNext)
                        ||
                       []
                     ).addClass("disabled");
                }

            }
            return false;
        };
    });
};

function css(el, prop) {
    return parseInt($.css(el[0], prop)) || 0;
};
function width(el) {
    return  el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight');
};
function height(el) {
    return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom');
};

})(jQuery);

/*------------  ENDjcarousellite_1.0.1.js -----------*/

function mouseIn(){
$("#ddMenu").css("display","")
}
function mouseOut(){
$("#ddMenu").css("display","none")

}

function fnHideShowText(objTextObject, strTempText, strTextClass)
{
	if (objTextObject.value == strTempText)
	{
		objTextObject.value = "";
		objTextObject.className = "";
	}
	else if (objTextObject.value == "")
	{
		objTextObject.value = strTempText;
		objTextObject.className = strTextClass;
	}
}


/*********************
//* jQuery Multi Level CSS Menu #2- By Dynamic Drive: http://www.dynamicdrive.com/
//* Last update: Nov 7th, 08': Limit # of queued animations to minmize animation stuttering
//* Menu avaiable at DD CSS Library: http://www.dynamicdrive.com/style/
*********************/

//Specify full URL to down and right arrow images (23 is padding-right to add to top level LIs with drop downs):
//var arrowimages={down:['downarrowclass', '../images/down.gif', 23], right:['rightarrowclass', '../images/right.gif']}

var jqueryslidemenu={

animateduration: {over: 200, out: 100}, //duration of slide in/ out animation, in milliseconds

buildmenu:function(menuid){
	jQuery(document).ready(function($){
		var $mainmenu=$("#"+menuid+">ul")
		var $headers=$mainmenu.find("ul").parent()
		$headers.each(function(i){
			var $curobj=$(this)
			var $subul=$(this).find('ul:eq(0)')
			this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
			this.istopheader=$curobj.parents("ul").length==1? true : false
			$subul.css({top:this.istopheader? this._dimensions.h+"px" : 0})
			/*$curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: arrowsvar.down[2]} : {}).append(
				'<img src="'+ (this.istopheader? arrowsvar.down[1] : arrowsvar.right[1])
				+'" class="' + (this.istopheader? arrowsvar.down[0] : arrowsvar.right[0])
				+ '" style="border:0;" />'
			)*/
			$curobj.hover(
				function(e){
					var $targetul=$(this).children("ul:eq(0)")
					this._offsets={left:$(this).offset().left, top:$(this).offset().top}
					var menuleft=this.istopheader? 0 : this._dimensions.w
					menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft
					if ($targetul.queue().length<=1) //if 1 or less queued animations
						$targetul.css({left:menuleft+"px", width:this._dimensions.subulw+'px'}).slideDown(jqueryslidemenu.animateduration.over)
				},
				function(e){
					var $targetul=$(this).children("ul:eq(0)")
					$targetul.slideUp(jqueryslidemenu.animateduration.out)
				}
			) //end hover
		}) //end $headers.each()
		$mainmenu.find("ul").css({display:'none', visibility:'visible'})
	}) //end document.ready
}
}

//build menu with ID="myslidemenu" on page:
jqueryslidemenu.buildmenu("myslidemenu")

//Function for Show/Hide Options in Global search Tpl

/**
*
*  URL encode / decode
*  http://www.webtoolkit.info/
*
**/
 
var Url = {
 
	// public method for url encoding
	encode : function (string) {
		return escape(this._utf8_encode(string));
	},
 
	// public method for url decoding
	decode : function (string) {
		return this._utf8_decode(unescape(string));
	},
 
	// private method for UTF-8 encoding
	_utf8_encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";
 
		for (var n = 0; n < string.length; n++) {
 
			var c = string.charCodeAt(n);
 
			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
 
		}
 
		return utftext;
	},
 
	// private method for UTF-8 decoding
	_utf8_decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;
 
		while ( i < utftext.length ) {
 
			c = utftext.charCodeAt(i);
 
			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}
 
		}
 
		return string;
	}
}

function fnRedirectToSearch(strTextObject, strTempText, objBtnObject, strSearchOption, strErrorDiv,searchtype)
{
	objTextObject = document.getElementById(strTextObject);
	objTextObject.value = objTextObject.value.replace(/^\s+|\s+$/g,"").replace(/^\s+/,"").replace(/\s+$/,"");
	
	if (objTextObject.value == strTempText || objTextObject.value == "")
	{
		ajax_showTooltip(strErrorDiv,objBtnObject,220,20);
		objTextObject.value =strTempText;
		objTextObject.className='txtGray';
		return false;
	}
	
	if (objTextObject.value.length >199)
	{
		if(searchtype)		
			ajax_showTooltip("id_GlobalExceedError_"+searchtype,objBtnObject,220,45);
		else
			ajax_showTooltip("id_GlobalExceedError",objBtnObject,220,45);
		
		return false;
	}
	
	//objTextObject.value=Url.encode(objTextObject.value);
	//strSearchKeyWord = objTextObject.value.replace("+"," ");
	strSearchKeyWord = Url.encode(objTextObject.value);
	if(searchtype)
	{
			strSearchLink = sitename+"/globalsearch?q="+strSearchKeyWord+"&search="+searchtype;
	}
	else
	{
		strSearchLink = sitename+"/globalsearch?q="+strSearchKeyWord;
	}
	
	if (strSearchOption != "")
		strSearchLink = strSearchLink+"&search="+strSearchOption;
		
	window.location = strSearchLink;
}

function fnSetFadeEffects(strDivId)
{
	if (strDivId != "")
	{
		try{
		setTimeout("fnChangeColorOfElement('"+strDivId+"','0.50')",1500);
		setTimeout("fnChangeColorOfElement('"+strDivId+"','0.40')",1580);
		setTimeout("fnChangeColorOfElement('"+strDivId+"','0.30')",1660);
		setTimeout("fnChangeColorOfElement('"+strDivId+"','0.20')",1740);
		setTimeout("fnChangeColorOfElement('"+strDivId+"','0.10')",1820);
		setTimeout("fnHideDIv('"+strDivId+"')",1821);
		}
		catch(e)
		{}
	}
}

function fnSetFadeEffectsForRegistration(strDivId)
{
	if (strDivId != "")
	{
		try{
		setTimeout("fnChangeColorOfElement('"+strDivId+"','0.50')",1800);
		setTimeout("fnChangeColorOfElement('"+strDivId+"','0.40')",1880);
		setTimeout("fnChangeColorOfElement('"+strDivId+"','0.30')",1860);
		setTimeout("fnChangeColorOfElement('"+strDivId+"','0.20')",1940);
		setTimeout("fnChangeColorOfElement('"+strDivId+"','0.10')",2100);
		setTimeout("fnHideDIv('"+strDivId+"')",2120);
		}
		catch(e)
		{}
	}
}

function fnChangeColorOfElement(intIdOfElement,strColor)
{
	document.getElementById(intIdOfElement).style.opacity = strColor;
}

function fnHideDIv(intIdOfElement)
{
	document.getElementById(intIdOfElement).style.opacity = 1;
	document.getElementById(intIdOfElement).style.display = "none";
}

/*
WE HAVE SET THIS VARIABLE FOR REDIRECT USER AFTER REDIRECTION.
FOR SOME ACTIONS WE NEED TO LOAD CURRENT WINDOW, SO USING THIS 
VARIABLE WE CAN DO THAT.
*/
var enmReloadCurrentWindow;
enmReloadCurrentWindow = false;

/*
*  FUNCTION TO VALIDATE USER'S LOGIN PRCESS
*/
function fnValidateUserLogin()
{
	// VALIDE FORM INPUTS
	lightbox = 0;
	errordiv = "";
	showerrorinlable = 1;
	
	if (fnValidateForm(document.getElementById("id_frmLogin")) == false)
		return false;
		
	// SHOW LOADER IMAGE
	document.getElementById("id_LoginEnter").style.display = "none";
	document.getElementById("id_LoginLoader").style.display = "";
	
	// GET LOGIN DETAILS FOR AJAX CALL
	strLoginEmail 	 = Base64.encode(document.getElementById("id_txtLoginEmail").value);
	strLoginPassword = Base64.encode(document.getElementById("id_txtPassword").value);
	strLoginCaptcha  = document.getElementById("id_txtLoginCaptcha").value;
	strLoginGoToLink = document.getElementById("id_GoToLink").value;
	
	if (document.getElementById("id_LoginCaptcha").style.display == "")
		strLoginCaptcha = "&txtLoginCaptcha="+strLoginCaptcha;
	else
		strLoginCaptcha = "";
	
	// LOGIN AJAX CALL
	ajaxObjects[101] = new sack();
	ajaxObjects[101].PostParam = "&email="+strLoginEmail+"&password="+strLoginPassword+"&goto="+strLoginGoToLink+"&frame="+intIsIframe+strLoginCaptcha;
	ajaxObjects[101].requestFile = securedsitename+"/index.php?action=justmeans-login&mode=ajax&ajax_action=validatelogin";
	ajaxObjects[101].onCompletion = function(){
													fnAfterLoginProcess();
											  };
	ajaxObjects[101].onError = function(){
												ajaxObjects[101].response = "success|"+sitename;
												fnAfterLoginProcess();
										   };
	ajaxObjects[101].runAJAX();
	
	return false;
}

function fnAfterLoginProcess()
{
	// GET LOGIN AJAX CALL RESPONSE
	strResponse = ajaxObjects[101].response;
	arrResponse = strResponse.split('|');
	
	// CHECKING enmReloadCurrentWindow FLAG
	// THIS FLAG WILL ALWAYS HAVE A FIRST PRIORITY
	if (enmReloadCurrentWindow && arrResponse[0] == "success")
	{
		// RELOAD CURRENT WINDOW
		window.location = arrResponse[1];
		return true;
	}
	
	// TAKE RESPECTED ACTION AFTER RESPONSE
	if (arrResponse[0] == "success")
	{
		// RELOAD MAIN WINDOW WITH NEW LOCATION
		// WE ARE USING TRY CATCH COZ ON IE ITS SHOWING PERMISSION DENIED [CROSS DOMAIN REDIRECTION ISSUE].
		try{
			parent.window.location = arrResponse[1];
		}
		catch(e)
		{
			window.location.href = sitename+"/util/redirect.php?param="+Base64.encode(arrResponse[1]);
		}
	}
	else if (arrResponse[0] == "dual")
	{
		// RELOAD IFRAME FOR DUAL ACCOUNT
		window.location = arrResponse[1];
	}
	else if (arrResponse[0] == "captcha")
	{
		// HIDE LOADER IMAGE
		document.getElementById("id_LoginEnter").style.display = "";
		document.getElementById("id_LoginLoader").style.display = "none";

		fnViewLoginCaptch();
		
		// DISPLAY ERROR MESSAGE
		fnShowLoginErrorMessage(arrResponse[1]);
		
		// DISPLAY CAPTCH BLOCK
		document.getElementById("id_txtLoginCaptcha").alt = "M-Enter above word.";
		document.getElementById("id_LoginCaptcha").style.display = "";
	}
	else
	{
		// HIDE LOADER IMAGE
		document.getElementById("id_LoginEnter").style.display = "";
		document.getElementById("id_LoginLoader").style.display = "none";
		
		// DISPLAY ERROR MESSAGE
		fnShowLoginErrorMessage(arrResponse[1]);
	}
}

function fnSetValues(objText, strText, strTextLable)
{
	strObjectId = objText.id;
	strObjectLableId = strObjectId+"Err";
	
	if (objText.type == "text")
	{
		if (objText.value == strText)
		{
			objText.value = "";
			objText.style.color=  "#000000";
			document.getElementById(strObjectLableId).innerHTML = strTextLable;
		}
		else if (objText.value == "")
		{
			objText.value = strText;
			objText.style.color=  "";
			document.getElementById(strObjectLableId).innerHTML = "";
		}
	}
	else if (objText.type == "password")
	{
		if (objText.className == strText)
		{
			objText.className = "input";
			document.getElementById(strObjectLableId).innerHTML = strTextLable;
		}
		else if (objText.value == "")
		{
			objText.className = strText;
			document.getElementById(strObjectLableId).innerHTML = "";
		}
	}
}

function fnRegisterBack()
{
	// SHOW REGISTRATION BOX AND HIDE CAPTCHA BOX
	document.getElementById("id_tblRegister").style.display = "";
	document.getElementById("id_Captcha").style.display = "none";
	
	// SHOW LOGIN BOX
	document.getElementById("id_LoginBlock").style.display = "";
}

function fnViewLoginCaptch()
{
	ajaxObjects[102] = new sack();
	ajaxObjects[102].requestFile = securedsitename+"/index.php?action=justmeans-login&mode=ajax&ajax_action=viewlogincaptcha";
	ajaxObjects[102].onCompletion = function(){
													document.getElementById("id_LoginCaptchaImg").src = ajaxObjects[102].response;
											  };
	ajaxObjects[102].runAJAX();
}

function fnTrim(str, chars) {
	return fnLtrim(fnRtrim(str, chars), chars);
}
 
function fnLtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function fnRtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

// Added by Shweta for new registration

function fnProcessRegister()
{ 
	strIsDisplay = document.getElementById("id_Captcha").style.display;
	if(strIsDisplay == "none")
		intStep = 1;
	else
		intStep = 2;
		
	if(intStep == 1)
	{ 
		strFname = document.getElementById("id_txtFname").value;
		strLname = document.getElementById("id_txtLname").value;
		strEmail = document.getElementById("id_txtEmail").value;
		strPassword = document.getElementById("id_txtRegPassword").value;
		
		if (strFname == "First Name")
			document.getElementById("id_txtFname").value = "";
		if (strLname == "Last Name")
			document.getElementById("id_txtLname").value = "";
		if (strEmail == "Email")
			document.getElementById("id_txtEmail").value = "";
		if (strPassword == "")
			document.getElementById("id_txtRegPassword").className = "input";
			
		lightbox = 0;
		errordiv = "";
		showerrorinlable = 1;
		if (fnValidateForm(document.getElementById("id_frmRegister")) == false)
			return false;
		else
		{ 
			fnHideLoginErrorMessage();
			document.getElementById("id_RegisterLoader").style.display = "";
			document.getElementById("id_registerbtn").style.display = "none";
			
			/*strFname = document.getElementById("id_txtFname").value;
			strLname = document.getElementById("id_txtLname").value;
			strEmail = document.getElementById("id_txtEmail").value;
		    strPassword = document.getElementById("id_txtRegPassword").value;*/
		
			
			strEncodedFName = Base64.encode(strFname); 
			strEncodedLName = Base64.encode(strLname);
			strEncodedEmail = Base64.encode(strEmail);
			strEncodedPassword = Base64.encode(strPassword);
			
			ajaxObjects[101] = new sack();
			ajaxObjects[101].PostParam = "&fname="+strEncodedFName+"&lname="+strEncodedLName+"&email="+strEncodedEmail+"&password="+strEncodedPassword;
			ajaxObjects[101].requestFile = securedsitename+"/index.php?action=getregistred&mode=ajax&ajax_action=validateregistration"; 
			ajaxObjects[101].onCompletion = function(){ 
														 if(ajaxObjects[101].response=="")
														 { 
															  document.getElementById("id_RegisterLoader").style.display = "none";
															  document.getElementById("id_registerbtn").style.display = "";
															  
															 // SHOW CAPTCHA TABLE
															  document.getElementById("id_tblRegister").style.display = "none";
															  document.getElementById("id_Captcha").style.display = "";
															  
															  // HIDE LOGIN TABLE FOR SECURITY CHECK
															  document.getElementById("id_LoginBlock").style.display = "none";
															  
															 // GENERATE NEW CAPTCHA FOR REGISTRATION
															  document.getElementById("id_CaptchaText").value = "";
															  fnViewRegistrationCaptcha();
																
														 }
														 else
														 {
															  fnHideLoginErrorMessage();
															  document.getElementById("id_Captcha").style.display = "none";	
															  document.getElementById("id_tblRegister").style.display = "";
															  
															  document.getElementById("id_RegisterLoader").style.display = "none";
															  document.getElementById("id_registerbtn").style.display = "";	
															  
															  fnShowLoginErrorMessage(ajaxObjects[101].response);
														 }
						 							  };
			 ajaxObjects[101].runAJAX();
		}
		return false;
	}
	else if(intStep  == 2)
	{
		if (document.getElementById("id_CaptchaText").value == "")
		{
			fnShowLoginErrorMessage("You did not correctly type the word in the Security Check box.<br> Please try again.");
			return false;
		}
		else
		{
			fnHideLoginErrorMessage();
			document.getElementById("id_CaptchaLoader").style.display = "";
			document.getElementById("id_captchbtn").style.display = "none";
			
			strCaptchaText = document.getElementById("id_CaptchaText").value;
			
			ajaxObjects[102] = new sack();
			ajaxObjects[102].PostParam = "&registrationcaptcha="+strCaptchaText;
			ajaxObjects[102].requestFile = securedsitename+"/index.php?action=getregistred&mode=ajax&ajax_action=validatecaptcha";
			ajaxObjects[102].onCompletion = function(){
														 if(ajaxObjects[102].response=="")
														 {
															 fnFinalRegistration();
														 }
														 else
														 {
															  document.getElementById("id_CaptchaLoader").style.display = "none";
															  document.getElementById("id_captchbtn").style.display = "";
															  
															  fnShowLoginErrorMessage(ajaxObjects[102].response);
														 }
						 							  };
			 ajaxObjects[102].runAJAX();
		}
	}
	return false;
}


function fnViewRegistrationCaptcha()
{
	document.getElementById("id_captcha_image").src = "images/ajax-loader-bar.gif";
	ajaxObjects[102] = new sack();
	ajaxObjects[102].requestFile = securedsitename+"/index.php?action=getregistred&mode=ajax&ajax_action=viewlogincaptcha";
	ajaxObjects[102].onCompletion = function(){
													document.getElementById("id_captcha_image").src = ajaxObjects[102].response;
											  };
	ajaxObjects[102].runAJAX();
}

function fnFinalRegistration()
{
	strFname = Base64.encode(document.getElementById("id_txtFname").value);
	strLname = Base64.encode(document.getElementById("id_txtLname").value);
	strEmail =  Base64.encode(document.getElementById("id_txtEmail").value);
	strPassword =  Base64.encode(document.getElementById("id_txtRegPassword").value);
	strGoToLink =  Base64.encode(document.getElementById("id_GoToLink").value);

	if(intIsIframe == 1)
		var strExtraParam = "&f=1";
	else
		var strExtraParam = "";
		
	ajaxObjects[103] = new sack();
	ajaxObjects[103].PostParam = "&fname="+strFname+"&lname="+strLname+"&email="+strEmail+"&password="+strPassword+"&goto="+strGoToLink+strExtraParam;
	ajaxObjects[103].requestFile = securedsitename+"/index.php?action=getregistred&mode=ajax&ajax_action=finalstep";
	ajaxObjects[103].onCompletion = function(){
												 if(ajaxObjects[103].response!="")
												 {
													 arrErrSucc = ajaxObjects[103].response.split("|"); 
													 if(arrErrSucc[0] == "success")
													 {
														intIsIframe = ""
														window.location = arrErrSucc[2];
													 }
													 else
													 {
													  document.getElementById("id_CaptchaLoader").style.display = "none";
													  document.getElementById("id_captchbtn").style.display = "";
													  
													  fnShowLoginErrorMessage(arrErrSucc[1]);
												 	}
												 }
												 
											  };
	 ajaxObjects[103].runAJAX();
}

function fnResendVarificationEmail(strEmail)
{ 
	if(strEmail!="")
	{
		if(siteid == "sg" || siteid == "sia")
		{
			document.getElementById("resendloader").style.display = "";
			document.getElementById("btn_resend").style.display = "none";
		}
		else
		{
			if(document.getElementById("AccessRgtDiv").style.display == "")
			{
				document.getElementById("Acresendloader").style.display = "";
				document.getElementById("btn_Acresend").style.display = "none";
			}
			else
			{
				document.getElementById("resendloader").style.display = "";
				document.getElementById("btn_resend").style.display = "none";
			}
		}
		ajaxObjects[103] = new sack();
		strEncodedEmail = Base64.encode(strEmail);
		ajaxObjects[103].PostParam = "&email="+strEncodedEmail;
		ajaxObjects[103].requestFile = securedsitename+"/index.php?action=getregistred&mode=ajax&ajax_action=resendvarification";
		ajaxObjects[103].onCompletion = function(){
													  if(siteid == "sg" || siteid == "sia")
													  {
														 document.getElementById("resendloader").style.display = "none";
														 document.getElementById("btn_resend").style.display = "";
													  }
													  else
													  {
														 if(document.getElementById("AccessRgtDiv").style.display == "")
														 {
															document.getElementById("Acresendloader").style.display = "none";
															document.getElementById("btn_Acresend").style.display = "";
														 }
														 else
														 {
															 document.getElementById("resendloader").style.display = "none";
															 document.getElementById("btn_resend").style.display = "";
														 }
													  }
													  if(siteid == "sg" || siteid == "sia")
													  {
														  ajax_showTooltip("id_resend",document.getElementById("btn_resend"),170,20);
													  }
													  else
													  {
														if(document.getElementById("AccessRgtDiv").style.display == "")
															ajax_showTooltip("id_resend",document.getElementById("btn_Acresend"),170,20);
														else
															ajax_showTooltip("id_resend",document.getElementById("btn_resend"),170,20);
													  }
													  boolAutoHide = 1;
													  setTimeout("fnHideMessage("+"'id_resend')",3000);		
													 
												  };
		 ajaxObjects[103].runAJAX();
	}
}

function fnResendSimpleVarificationEmail(strEmail)
{
	if(strEmail=="")
		return "";
	
	strEncodedEmail = Base64.encode(strEmail);
	
	document.getElementById("btn_resendloader").style.display = "";
	document.getElementById("btn_resend").style.display = "none";
	
	ajaxObjects[104] = new sack();
	ajaxObjects[104].PostParam = "&email="+strEncodedEmail;
	ajaxObjects[104].requestFile = sitename+"/index.php?action=getregistred&mode=ajax&ajax_action=resendvarification";
	ajaxObjects[104].onCompletion = function(){
													document.getElementById("btn_resendloader").style.display = "none";
													document.getElementById("btn_resend").style.display = "";
													
													fnToggleMessageDiv("successmessage");
													setTimeout("fnToggleMessageDiv('successmessage');",5000);
													//ajax_showTooltip("successmessage",document.getElementById("btn_resend"),250,25);
													//document.getElementById("successmessage").style.display = "";
													//fnSetFadeEffectsForRegistration("successmessage");
											  };
	 ajaxObjects[104].runAJAX();
}

function fnToggleMessageDiv(strMessageDivId)
{
	$("#"+strMessageDivId).slideToggle();
}

function fnLoginRequired(strPageAction)
{
	document.getElementById("id_LoginFrame").src = securedsitename + "/index.php?action=logmein&frame=1&goto=" + Base64.encode(strPageAction);
	Lightbox.showBoxByID("divRegisterLogin", intLoginPopupWidth, intLoginPopupHeight);
}

function fnReSetLoginPop()
{
	//intHeight = parent.document.getElementById("id_LoginFrame").contentWindow.document.body.scrollHeight;
	intHeight = parent.document.getElementById("id_LoginFrame").contentWindow.document.body.scrollHeight;
	intWidth = parent.document.getElementById("id_LoginFrame").contentWindow.document.body.scrollWidth;

	parent.document.getElementById("id_LoginFrame").style.height = intHeight + "px";
	parent.document.getElementById("id_LoginFrame").style.height = intWidth + "px";
	
	intHeight = intHeight + 40;
	intWidth = intWidth + 40;
	
	parent.document.getElementById("box").style.height = intHeight + "px";
	parent.document.getElementById("box").style.width = intWidth+"px";
}

var isBoxHide = true;
var isBoxShow = false;

function fnShowLoginErrorMessage(strMessage)
{
	isBoxHide = false;
	strHtml = "<img src='images/ico_delete.gif' alt='close' title='close' onclick='fnHideLoginErrorMessage();' />"+strMessage;
	document.getElementById("id_ErrorMessage").innerHTML = strHtml;
	if (isBoxShow == false)
		$("#id_ErrorMessage").slideToggle();
	isBoxShow = true;
	//setTimeout("fnHideLoginErrorMessage();",5000);
}

function fnHideLoginErrorMessage()
{
	if (isBoxHide)
		return;
		
	$("#id_ErrorMessage").slideToggle();
	isBoxShow = false;
	isBoxHide = true;
}

var strLocation = "";
function fnReloadParentWindow()
{
	if (strLocation == "")
		return "";

	parent.window.location = strLocation;
}

function fnDeleteUserUpdatesFollowList(intStatusMsgId)
{
	ajax_hideTooltip();
	window.location = sitename+"/deletetweet?tweetid="+intStatusMsgId+"&location=myprofile";		
	return true;
}

function fnSetTollTipForDeleteUserUpdatesFollowList(strElementId)
{
	isCloseBtnEnable = false;
	ajax_showTooltip('id_divDeleteUserUpdatesFollowList_'+strElementId,document.getElementById('id_imgDeleteUserUpdatesFollowList_'+strElementId),290,55);
}