


var vs_active_tab = 0;
var vs_menu=new Array();
var vs_submenu=new Array();



lct = document.location.href.toLowerCase();
p = 'http://www.vemmasuite.com/';

/* if( lct.indexOf( p+'/website/' ) >= 0 ) vs_active_tab = 1; */
if( lct.indexOf( p+'contact/' ) >= 0 ) vs_active_tab = 1;
if( lct.indexOf( p+'media/' ) >= 0 ) vs_active_tab = 2;
if( lct.indexOf( p+'meeting/' ) >= 0 ) vs_active_tab = 3;
if( lct.indexOf( p+'address_book.html' ) >= 0 ) vs_active_tab = 4;
if( lct.indexOf( p+'finder_downline.html' ) >= 0 ) vs_active_tab = 5;
if( lct.indexOf( p+'calendar.html' ) >= 0 ) vs_active_tab = 6;
if( lct.indexOf( p+'account_support' ) >= 0 ) vs_active_tab = 8;
if( lct.indexOf( p+'account_settings' ) >= 0 ) vs_active_tab = 9;
if( lct.indexOf( p+'account_upgrade' ) >= 0 ) vs_active_tab = 9;
if( lct.indexOf( p+'account_govemma' ) >= 0 ) vs_active_tab = 9;


vs_menu[0] = {
		'name':'My Account',
		'trans_icon':'',
		'url':'http://www.vemmasuite.com/account.html',
		'upgrade_position':100,
		'active':'1'
	};


  vs_menu[1] = {
      'name':'Contact',
      'trans_icon':'',
      'url':'http://www.vemmasuite.com/account_goto.html?tool=contact',
			'upgrade_position':120,
			'active':0
        };
	vs_menu[2] = {
			'name':'Media',
			'trans_icon':'',
			'url':'http://www.vemmasuite.com/media/',
			'upgrade_position':182,
			'active':0
	};
	vs_menu[3] = {
			'name':'Meeting',
			'trans_icon':'',
			'url':'http://www.vemmasuite.com/account_goto.html?tool=meeting',
			'upgrade_position':247,
			'active':0
	};
	vs_menu[4] = {
			'name':'Address Book',
			'trans_icon':'',
			'url':'http://www.vemmasuite.com/address_book.html',
			'upgrade_position':332,
			'active':0
	};
	vs_menu[5] = {
			'name':'Finder',
			'trans_icon':'',
			'url':'http://www.vemmasuite.com/finder_downline.html',
			'upgrade_position':414,
			'active':-1
	};
	vs_menu[6] = {
			'name':'Calendar',
			'trans_icon':'',
			'url':'http://www.vemmasuite.com/calendar.html',
			'upgrade_position':482,
			'active':0
	};
	vs_menu[7] = {
			'name':'WebMail',
			'trans_icon':'',
			'url':'#',
			'onclick_action':'document.webmailAutoLogin.submit()',
			'upgrade_position':555,
			'active':0
	}
	vs_menu[8] = {
			'name':'Support',
			'trans_icon':'',
			'url':'http://www.vemmasuite.com/account_support.html',
			'upgrade_position':100,
			'active':1,
			'sub_menu_index':8
	};
			vs_submenu[8]=new Array();
			vs_submenu[8][0] = {
				'name':'FAQ',
				'trans_icon':'',
				'url':'http://www.vemmasuite.com/account_support_faq.html',
				'active':1
			};
			vs_submenu[8][1] = {
				'name':'User Manual',
				'trans_icon':'',
				'url':'http://www.vemmasuite.com/account_support_manual.html',
				'active':1
			};
			vs_submenu[8][2] = {
				'name':'Contact Support',
				'trans_icon':'',
				'url':'http://www.vemmasuite.com/account_support_contact.html',
				'active':1
			};
			vs_submenu[8][3] = {
				'name':'Tutorials',
				'trans_icon':'',
				'url':'http://www.vemmasuite.com/account_support_tutorials.html',
				'active':1
			};

	vs_menu[9] = {
			'name':'Account Settings',
			'trans_icon':'',
			'url':'http://www.vemmasuite.com/account_settings.html',
			'upgrade_position':100,
			'active':1,
			'sub_menu_index':9
	};
			vs_submenu[9]=new Array();
			vs_submenu[9][0] = {
				'name':'Account Details',
				'trans_icon':'',
				'url':'http://www.vemmasuite.com/account_settings_details.html',
				'active':1
			};
			vs_submenu[9][1] = {
        'name':'Billing Details',
				'trans_icon':'',
        'url':'http://www.vemmasuite.com/account_settings_billing.html',
				'active':1
                        };
			vs_submenu[9][2] = {
        'name':'Go!Vemma Mail Settings',
				'trans_icon':'',
        'url':'http://www.vemmasuite.com/account_govemma_settings.html',
        'active':1
      };
			
			vs_submenu[9][3] = {
				'name':'Change Password',
				'trans_icon':'',
				'url':'http://www.vemmasuite.com/account_settings_password.html',
				'active':1
			};

	vs_menu[10] = {
			'name':'Logout',
			'trans_icon':'',
			'url':'http://www.vemmasuite.com/logout.html',
			'onclick_action':"if( !confirm('Are you sure you want to logout?') ) {this.blur(); return false;}",
			'upgrade_position':100,
			'active':1
	};



document.write( '<style type="text/css">' );
document.write( '#VSNaviWrapper {margin: 0 auto;width: 880px;background: #fff url(\'http://www.vemmasuite.com/images/menu-left.png\') no-repeat bottom left;z-index: 1001;margin-bottom:9px;}' );
document.write( 'ul#VSMainNavi {clear: both;z-index: 1001;display: block;list-style: none;margin: 0px 0px 0px 0px;padding: 0px;background: #fff url(\'http://www.vemmasuite.com/images/menu-right.png\') no-repeat bottom right;position: relative;}' );
document.write( 'ul#VSMainNavi:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;}' );
document.write( 'ul#VSMainNavi {display: inline-block;}' );
document.write( '* html ul#VSMainNavi {height: 1%;}' );
document.write( 'ul#VSMainNavi {display: block;}' );
document.write( 'ul#VSMainNavi li {display: block;float: left;margin: 0;padding: 0;position: relative;}' );
document.write( 'ul#VSMainNavi li a {display: block;float: none;width: auto;margin: 0;padding: 6px 10px;line-height: 20px;border-right: #e0e0e0 1px solid;font-family: tahoma,arial,sans-serif;font-size: 12px;font-weight: bold;color: #777;}' );
document.write( 'ul#VSMainNavi li.First a {}' );
document.write( 'ul#VSMainNavi li a:link, ul#VSMainNavi li a:visited {text-decoration: none;background: transparent url(\'http://www.vemmasuite.com/images/menu-off.png\') repeat-x bottom left;}' );
document.write( 'ul#VSMainNavi li.First a:link,ul#VSMainNavi li.First a:visited {background: transparent url(\'http://www.vemmasuite.com/images/menu-off-left.png\') repeat-x bottom left;}' );
document.write( 'ul#VSMainNavi li.active_tab a:link,ul#VSMainNavi li.active_tab a:visited,ul#VSMainNavi li:hover a:link,ul#VSMainNavi li:hover a:visited,ul#VSMainNavi li.hovered a:link,ul#VSMainNavi li.hovered a:visited,ul#VSMainNavi li a:focus, ul#VSMainNavi li a:hover, ul#VSMainNavi li a:active {  color: #fff;  text-decoration: none;background: transparent url(\'http://www.vemmasuite.com/images/menu-on.png\') repeat-x bottom left;}' );
document.write( 'ul#VSMainNavi li.First.active_tab a:link,ul#VSMainNavi li.First.active_tab a:visited,ul#VSMainNavi li.First:hover a:focus,ul#VSMainNavi li.First:hover a:hover,ul#VSMainNavi li.First:hover a:active,ul#VSMainNavi li.First.hovered a:focus,ul#VSMainNavi li.First.hovered a:hover,ul#VSMainNavi li.First.hovered a:active,ul#VSMainNavi li.First a:focus,ul#VSMainNavi li.First a:hover,ul#VSMainNavi li.First a:active {background: transparent url(\'http://www.vemmasuite.com/images/menu-on-left.png\') repeat-x bottom left;}' );
document.write( 'ul#VSMainNavi li ul {  position: absolute;  left: 0;  top: 30px;  width: auto;  display: none;  z-index: 1001;list-style: none;margin: 0;padding: 0 1px 1px 1px;background: #fff;float: none;clear: both;border: #cecece 1px solid;}' );
document.write( 'ul#VSMainNavi li:hover ul,ul#VSMainNavi li.hovered ul {  display: block;  width: 200px;  min-width: 200px;margin: 0;padding: 0;float: none;clear: both;overflow: visible;}' );
document.write( 'ul#VSMainNavi li ul li {display: block;float: none;width: 100%;margin: 0;padding: 0;position: relative;}' );
document.write( 'ul#VSMainNavi li:hover ul li a,ul#VSMainNavi li.hovered ul li a, ul#VSMainNavi li ul li a {display: block;float: none;margin: 0;padding: 8px 10px;color: #777;font-weight: normal;white-space: nowrap;zoom: 1;position: relative;  background-image: none;  border: none;}' );
document.write( 'ul#VSMainNavi li:hover ul li a:link, ul#VSMainNavi li:hover ul li a:visited,ul#VSMainNavi li.hovered ul li a:link, ul#VSMainNavi li.hovered ul li a:visited,ul#VSMainNavi li ul li a:link, ul#VSMainNavi li ul li a:visited {  background: #fff;  background-image: none;  text-decoration: none;  color: #777;}' );
document.write( 'ul#VSMainNavi li:hover ul li a:focus, ul#VSMainNavi li:hover ul li a:hover, ul#VSMainNavi li:hover ul li a:active,ul#VSMainNavi li.hovered ul li a:focus, ul#VSMainNavi li.hovered ul li a:hover, ul#VSMainNavi li.hovered ul li a:active,ul#VSMainNavi li ul li a:focus, ul#VSMainNavi li ul li a:hover, ul#VSMainNavi li ul li a:active {  background: #ff6d00;  background-image: none;  color: #fff;  text-decoration: none;}' );
document.write( 'ul#VSMainNavi li.Last a {border-right:0px;}' );
document.write( '#VSNaviWrapper a.upg,#VSNaviWrapper a:visited.upg,#VSNaviWrapper a:hover.upg {display:block;position:absolute;width:100px;height:20px;top:94px;text-align:center;color:red;font-weight:bold;font-size:10px;z-index:9000;text-decoration:none;}' );
document.write( '</style>' );


document.write( '<div id="VSNaviWrapper"><ul id="VSMainNavi">' );
var priv=new Array();
for( var position=0;position < vs_menu.length; position++ ) {
	if(!vs_menu[position]) continue;
	found_submenu = (vs_menu[position].sub_menu_index)?true:false;
	document.write( '<li'+   ((position==vs_active_tab||position==0||position==vs_menu.length-1)?' class="'+((position==0)?'First ':'')+((position==vs_menu.length-1)?'Last ':'')+((position==vs_active_tab)?'active_tab':'')+'"':'')   +'>' );

	priv[ position ] = new Array( vs_menu[position].active, vs_menu[position].upgrade_position  );

	if( vs_menu[position].active == 1 ) document.write( '<a href="'+vs_menu[position].url+'" title="'+vs_menu[position].name+'" '+((vs_menu[position].onclick_action)?'onclick="'+vs_menu[position].onclick_action+'"':'')+' '+((vs_menu[position].link_target)?'target="'+vs_menu[position].link_target+'"':'')+'>' );
	else document.write( '<a href="http://www.vemmasuite.com/'+(( vs_menu[position].active == -1 )?'account/invalid_vemma_status.html':'account_upgrade.html')+'" title="'+vs_menu[position].name+'" style="color:#e0e0e0">' );
		document.write( vs_menu[position].name );
	document.write( '</a>' + vs_menu[position].trans_icon );
	if(found_submenu) {
		document.write( '<ul>');
		for( var sub_position=0;sub_position < vs_submenu[vs_menu[position].sub_menu_index].length; sub_position++ ) {
			if( vs_submenu[vs_menu[position].sub_menu_index][sub_position].active ) document.write( '<li><a href="'+vs_submenu[vs_menu[position].sub_menu_index][sub_position].url+'" title="'+vs_submenu[vs_menu[position].sub_menu_index][sub_position].name+'" '+((vs_submenu[vs_menu[position].sub_menu_index][sub_position].onclick_action)?'onclick="'+vs_submenu[vs_menu[position].sub_menu_index][sub_position].onclick_action+'"':'')+' '+((vs_submenu[vs_menu[position].sub_menu_index][sub_position].link_target)?'target="'+vs_submenu[vs_menu[position].sub_menu_index][sub_position].link_target+'"':'')+'>' );
			else document.write( '<li><a href="http://www.vemmasuite.com/account_upgrade.html" title="'+vs_submenu[vs_menu[position].sub_menu_index][sub_position].name+'" style="color:#e0e0e0">' );
				document.write( vs_submenu[vs_menu[position].sub_menu_index][sub_position].name );
			document.write( '</a>' + vs_submenu[vs_menu[position].sub_menu_index][sub_position].trans_icon + '</li>' );
		}
		document.write( '</ul>');
	}
	document.write( '</li>' );
}
document.write( '</ul>' );

for( var position=0; position < priv.length; position++) {
	if( !priv[position][0]) document.write( '<a style="left:'+priv[position][1]+'px;" href="http://www.vemmasuite.com/account_upgrade.html" class="upg">UPGRADE!<br /><img src="http://www.vemmasuite.com/images/upgrade_arrow.png" border="0" /></a>' );
}


document.write( '</div>' );
document.write( '<form style="margin:0px;padding:0px;" target="_blank" name="webmailAutoLogin" action="http://www.govemma.com/webmail/" method="post"><input type="hidden" name="_autologin" value="vs" /><input name="_action" value="login" type="hidden" /><input name="_user" value="" type="hidden" /><input name="_pass" value="" type="hidden" /></form>' );

function VemmaSuiteMainMenuScript() {
	var Navi = document.getElementById("VSMainNavi");
	var VSMEls = Navi.getElementsByTagName("li");
	for (var i=0; i<VSMEls.length; i++) {
		if( VSMEls[i].className.indexOf('Last')!=-1&&VSMEls[i].className.indexOf('active_tab')!=-1) {
			Navi.style.background='transparent url(\'http://www.vemmasuite.com/images/menu-on-right.png\') repeat-x bottom right;';
		}
		VSMEls[i].onmouseover=function() {
			this.className+=" hovered";
			if(this.className.indexOf('Last')!=-1) document.getElementById("VSMainNavi").style.background='transparent url(\'http://www.vemmasuite.com/images/menu-on-right.png\') repeat-x bottom right;';
		}
		VSMEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp("hovered\\b"), "");
			if(this.className.indexOf('Last')!=-1&&this.className.indexOf('active_tab')==-1) document.getElementById("VSMainNavi").style.background='#fff url(\'http://www.vemmasuite.com/images/menu-right.png\') no-repeat bottom right;';
		}
	}
}

function addEventJS(obj, evType, fn){
	if (obj.addEventListener){
		obj.addEventListener(evType, fn, false);
		return true;
	} else if (obj.attachEvent){
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	} else {
		return false;
	}
}
addEventJS(window, 'load', VemmaSuiteMainMenuScript);






	// set session expiration time
	var session_expiration = '10800';
	var expiration_url = 'http://www.vemmasuite.com/';

	function SessionExpiration()
	{
		alert("Your session has expired. Please log in again.");
		window.location = mainurl;
	}

	if (session_expiration)
	{
		window.setTimeout("SessionExpiration()", session_expiration * 1000);
	}





function advAJAX(){var obj=new Object();obj.url=window.location.href;obj.method="GET";obj.parameters=new Object();obj.jsonParameters=new Object();obj.headers=new Object();obj.async=true;obj.mimeType="text/xml";obj.username=null;obj.password=null;obj.form=null;obj.disableForm=true;obj.unique=true;obj.uniqueParameter="_uniqid";obj.requestDone=false;obj.queryString="";obj.responseText=null;obj.responseXML=null;obj.status=null;obj.statusText=null;obj.aborted=false;obj.timeout=0;obj.retryCount=0;obj.retryDelay=1000;obj.tag=null;obj.group=null;obj.progressTimerInterval=50;obj.xmlHttpRequest=null;obj.onInitialization=null;obj.onFinalization=null;obj.onReadyStateChange=null;obj.onLoading=null;obj.onLoaded=null;obj.onInteractive=null;obj.onComplete=null;obj.onProgress=null;obj.onSuccess=null;obj.onFatalError=null;obj.onError=null;obj.onTimeout=null;obj.onRetryDelay=null;obj.onRetry=null;obj.onGroupEnter=null;obj.onGroupLeave=null;obj.createXmlHttpRequest=function(){if(typeof XMLHttpRequest!="undefined"){return new XMLHttpRequest()}var xhrVersion=["MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","Microsoft.XMLHttp"];for(var i=0;i<xhrVersion.length;i++){try{var xhrObj=new ActiveXObject(xhrVersion[i]);return xhrObj}catch(e){}}obj.raiseEvent("FatalError");return null};obj._oldResponseLength=null;obj._progressTimer=null;obj._progressStarted=navigator.userAgent.indexOf("Opera")==-1;obj._onProgress=function(){if(typeof obj.onProgress=="function"&&typeof obj.xmlHttpRequest.getResponseHeader=="function"){var contentLength=obj.xmlHttpRequest.getResponseHeader("Content-length");if(contentLength!=null&&contentLength!=""){var responseLength=obj.xmlHttpRequest.responseText.length;if(responseLength!=obj._oldResponseLength){obj.raiseEvent("Progress",obj,responseLength,contentLength);obj._oldResponseLength=obj.xmlHttpRequest.responseText.length}}}if(obj._progressStarted){return }obj._progressStarted=true;var _obj=this;this.__onProgress=function(){obj._onProgress();obj._progressTimer=window.setTimeout(_obj.__onProgress,obj.progressTimerInterval)};_obj.__onProgress()};obj._onInitializationHandled=false;obj._initObject=function(){if(obj.xmlHttpRequest!=null){delete obj.xmlHttpRequest["onreadystatechange"];obj.xmlHttpRequest=null}if((obj.xmlHttpRequest=obj.createXmlHttpRequest())==null){return null}if(typeof obj.xmlHttpRequest.overrideMimeType!="undefined"){obj.xmlHttpRequest.overrideMimeType(obj.mimeType)}obj.xmlHttpRequest.onreadystatechange=function(){if(obj==null||obj.xmlHttpRequest==null){return }obj.raiseEvent("ReadyStateChange",obj,obj.xmlHttpRequest.readyState);obj._onProgress();switch(obj.xmlHttpRequest.readyState){case 1:obj._onLoading();break;case 2:obj._onLoaded();break;case 3:obj._onInteractive();break;case 4:obj._onComplete();break}};obj._onLoadingHandled=obj._onLoadedHandled=obj._onInteractiveHandled=obj._onCompleteHandled=false};obj._onLoading=function(){if(obj._onLoadingHandled){return }if(!obj._retry&&obj.group!=null){if(typeof advAJAX._groupData[obj.group]=="undefined"){advAJAX._groupData[obj.group]=0}advAJAX._groupData[obj.group]++;if(typeof obj.onGroupEnter=="function"&&advAJAX._groupData[obj.group]==1){obj.onGroupEnter(obj)}}obj.raiseEvent("Loading",obj);obj._onLoadingHandled=true};obj._onLoaded=function(){if(obj._onLoadedHandled){return }obj.raiseEvent("Loaded",obj);obj._onLoadedHandled=true};obj._onInteractive=function(){if(obj._onInteractiveHandled){return }obj.raiseEvent("Interactive",obj);obj._onInteractiveHandled=true;if(!obj._progressStarted){obj._onProgress()}};obj._onComplete=function(){if(obj._onCompleteHandled||obj.aborted){return }if(obj._progressStarted){window.clearInterval(obj._progressTimer);obj._progressStarted=false}obj.requestDone=true;with(obj.xmlHttpRequest){obj.responseText=responseText;obj.responseXML=responseXML;if(typeof status!="undefined"){obj.status=status}if(typeof statusText!="undefined"){obj.statusText=statusText}}obj.raiseEvent("Complete",obj);obj._onCompleteHandled=true;if(obj.status==200){obj.raiseEvent("Success",obj)}else{obj.raiseEvent("Error",obj)}delete obj.xmlHttpRequest["onreadystatechange"];obj.xmlHttpRequest=null;if(obj.disableForm){obj.switchForm(true)}obj._groupLeave();obj.raiseEvent("Finalization",obj)};obj._groupLeave=function(){if(obj.group!=null){advAJAX._groupData[obj.group]--;if(advAJAX._groupData[obj.group]==0){obj.raiseEvent("GroupLeave",obj)}}};obj._retry=false;obj._retryNo=0;obj._onTimeout=function(){if(obj==null||obj.xmlHttpRequest==null||obj._onCompleteHandled){return }obj.aborted=true;obj.xmlHttpRequest.abort();obj.raiseEvent("Timeout",obj);obj._retry=true;if(obj._retryNo!=obj.retryCount){obj._initObject();if(obj.retryDelay>0){obj.raiseEvent("RetryDelay",obj);startTime=new Date().getTime();while(new Date().getTime()-startTime<obj.retryDelay){}}obj._retryNo++;obj.raiseEvent("Retry",obj,obj._retryNo);obj.run()}else{delete obj.xmlHttpRequest["onreadystatechange"];obj.xmlHttpRequest=null;if(obj.disableForm){obj.switchForm(true)}obj._groupLeave();obj.raiseEvent("Finalization",obj)}};obj.run=function(){obj._initObject();if(obj.xmlHttpRequest==null){return false}obj.aborted=false;if(!obj._onInitializationHandled){obj.raiseEvent("Initialization",obj);obj._onInitializationHandled=true}if(obj.method=="GET"&&obj.unique){obj.parameters[encodeURIComponent(obj.uniqueParameter)]=new Date().getTime().toString().substr(5)+Math.floor(Math.random()*100).toString()}if(!obj._retry){for(var a in obj.parameters){if(obj.queryString.length>0){obj.queryString+="&"}if(typeof obj.parameters[a]!="object"){obj.queryString+=encodeURIComponent(a)+"="+encodeURIComponent(obj.parameters[a])}else{for(var i=0;i<obj.parameters[a].length;i++){obj.queryString+=encodeURIComponent(a)+"="+encodeURIComponent(obj.parameters[a][i])+"&"}obj.queryString=obj.queryString.slice(0,-1)}}for(var a in obj.jsonParameters){var useJson=typeof [].toJSONString=="function";if(obj.queryString.length>0){obj.queryString+="&"}obj.queryString+=encodeURIComponent(a)+"=";if(useJson){obj.queryString+=encodeURIComponent(obj.jsonParameters[a].toJSONString())}else{obj.queryString+=encodeURIComponent(obj.jsonParameters[a])}}if(obj.method=="GET"&&obj.queryString.length>0){obj.url+=(obj.url.indexOf("?")!=-1?"&":"?")+obj.queryString}}if(obj.disableForm){obj.switchForm(false)}try{obj.xmlHttpRequest.open(obj.method,obj.url,obj.async,obj.username||"",obj.password||"")}catch(e){obj.raiseEvent("FatalError",obj,e);return }if(obj.timeout>0){setTimeout(obj._onTimeout,obj.timeout)}if(typeof obj.xmlHttpRequest.setRequestHeader!="undefined"){for(var a in obj.headers){obj.xmlHttpRequest.setRequestHeader(encodeURIComponent(a),encodeURIComponent(obj.headers[a]))}}if(obj.method=="POST"&&typeof obj.xmlHttpRequest.setRequestHeader!="undefined"){obj.xmlHttpRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded");obj.xmlHttpRequest.send(obj.queryString)}else{if(obj.method=="GET"){obj.xmlHttpRequest.send("")}}};obj.handleArguments=function(args){if(typeof args.form=="object"&&args.form!=null){obj.form=args.form;obj.appendForm()}for(a in args){if(typeof obj[a]=="undefined"){obj.parameters[a]=args[a]}else{if(a!="parameters"&&a!="headers"){obj[a]=args[a]}else{for(b in args[a]){obj[a][b]=args[a][b]}}}}obj.method=obj.method.toUpperCase()};obj.switchForm=function(enable){if(typeof obj.form!="object"||obj.form==null){return }with(obj.form){for(var nr=0;nr<elements.length;nr++){if(!enable){if(elements[nr]["disabled"]){elements[nr]["_disabled"]=true}else{elements[nr]["disabled"]="disabled"}}else{if(typeof elements[nr]["_disabled"]=="undefined"){elements[nr].removeAttribute("disabled")}}}}};obj.appendForm=function(){with(obj.form){obj.method=getAttribute("method").toUpperCase();obj.url=getAttribute("action");for(var nr=0;nr<elements.length;nr++){var e=elements[nr];if(e.disabled){continue}switch(e.type){case"text":case"password":case"hidden":case"textarea":obj.addParameter(e.name,e.value);break;case"select-one":if(e.selectedIndex>=0){obj.addParameter(e.name,e.options[e.selectedIndex].value)}break;case"select-multiple":for(var nr2=0;nr2<e.options.length;nr2++){if(e.options[nr2].selected){obj.addParameter(e.name,e.options[nr2].value)}}break;case"checkbox":case"radio":if(e.checked){obj.addParameter(e.name,e.value)}break}}}};obj.addParameter=function(name,value){if(typeof obj.parameters[name]=="undefined"){obj.parameters[name]=value}else{if(typeof obj.parameters[name]!="object"){obj.parameters[name]=[obj.parameters[name],value]}else{obj.parameters[name][obj.parameters[name].length]=value}}};obj.delParameter=function(name){delete obj.parameters[name]};obj.raiseEvent=function(name){var args=[];for(var i=1;i<arguments.length;i++){args.push(arguments[i])}if(typeof obj["on"+name]=="function"){obj["on"+name].apply(null,args)}if(name=="FatalError"){obj.raiseEvent("Finalization",obj)}};if(typeof advAJAX._defaultParameters!="undefined"){obj.handleArguments(advAJAX._defaultParameters)}return obj}advAJAX.get=function(A){return advAJAX.handleRequest("GET",A)};advAJAX.post=function(A){return advAJAX.handleRequest("POST",A)};advAJAX.head=function(A){return advAJAX.handleRequest("HEAD",A)};advAJAX.submit=function(C,A){if(typeof A=="undefined"||A==null){return -1}if(typeof C!="object"||C==null){return -2}var B=new advAJAX();A["form"]=C;B.handleArguments(A);return B.run()};advAJAX.assign=function(B,A){if(typeof A=="undefined"||A==null){return -1}if(typeof B!="object"||B==null){return -2}if(typeof B["onsubmit"]=="function"){B["_onsubmit"]=B["onsubmit"]}B["advajax_args"]=A;B["onsubmit"]=function(){if(typeof this["_onsubmit"]!="undefined"&&this["_onsubmit"]()===false){return false}if(advAJAX.submit(this,this["advajax_args"])==false){return true}return false};return true};advAJAX.download=function(B,A){if(typeof B=="string"){B=document.getElementById(B)}if(!B){return -1}advAJAX.get({url:A,onSuccess:function(C){B.innerHTML=C.responseText}})};advAJAX.scan=function(){var D=document.getElementsByTagName("a");for(var B=0;B<D.length;){if(D[B].getAttribute("rel")=="advancedajax"&&D[B].getAttribute("href")!==null){var A=D[B].getAttribute("href");var E=document.createElement("div");E.innerHTML=D[B].innerHTML;E.className=D[B].className;var C=D[B].parentNode;C.insertBefore(E,D[B]);C.removeChild(D[B]);advAJAX.download(E,A)}else{B++}}};advAJAX.handleRequest=function(A,B){if(typeof B=="undefined"||B==null){return -1}var C=new advAJAX();window.advajax_obj=C;C.method=A;C.handleArguments(B);return C.run()};advAJAX._defaultParameters=new Object();advAJAX.setDefaultParameters=function(A){advAJAX._defaultParameters=new Object();for(a in A){advAJAX._defaultParameters[a]=A[a]}};advAJAX._groupData=new Object()



document.write( '<style type="text/css">' );
document.write( '.eOcena0,.eOcena1,.eOcena2,.eOcena3,.eOcena4,.eOcena5{background:url(\'http://www.vemmasuite.com/images/estars.png\') no-repeat 0 0;height:18px;}' );
document.write( '.eOcena1{background-position:0 -20px;}' );
document.write( '.eOcena2{background-position:0 -40px;}' );
document.write( '.eOcena3{background-position:0 -60px;}' );
document.write( '.eOcena4{background-position:0 -80px;}' );
document.write( '.eOcena5{background-position:0 -100px;}' );
document.write( 'div#floatFBdiv {position:absolute;z-index:10000;right:0px;top:0px;border:0px;text-decoration:none;}' );
document.write( 'div#feedbackForm h4{margin: 0px;}' );
document.write( 'div#feedbackForm {border:1px solid #4B4B4B;background-color:white;padding:15px;position:absolute;left:-255px;top:-257px;width:270px;height:265px;text-align:left;display:none;font-family:arial;font-size:11px;}' );
document.write( 'a#FBclose {position:absolute;right:5px;top:3px;font-family:arial;text-decoration:none;font-size:10px;}' );
document.write( 'td.FBlabel {text-align:right; width: 80px; font-weight: bold;}' );
document.write( 'td.FBlabelCol {font-size:11px;font-weight: bold;}' );
document.write( 'a.FBstarClicker {width: 20px; height: 18px; text-decoration: none; cursor:pointer; float: left;}' );
document.write( '.fullWplus {width:95%;}' );
document.write( '.fullW {width:172px;}' );
document.write( 'div#FBmsg{text-align: center; color: #27AD50; font-weight: bold; display: block; width: 100%}' );
document.write( 'a#FBsendButton {display:block;text-align:center;font-size:10px;font-family:arial;color:#4B4B4B;border:0px;text-decoration:none;}' );
document.write( '</style>' );


var qq = '';
qq += '<div id="floatFBdiv">';
qq += '	<div id="feedbackForm">';
qq += '		<a id="FBclose" href="#" onclick="hideFeedbackForm();return false;">Close</a>';
qq += '		<h4>Send us Your Feedback:</h4>';
qq += '		<div id="FBmsg"></div>';
qq += '		<form id="ObjFeedbackForm" method="post" action="http://www.vemmasuite.com/ajax/submitFeedbackForm.php">';
qq += '		<table id="formFBtable" border="0" cellspacing="4" width="267">';
qq += '			<tr><td class="FBlabel FBlabelCol">Your name:</td><td><input type="text" name="name" value=" " class="fullW" /></td></tr>';
qq += '			<tr><td class="FBlabel FBlabelCol">E-mail address:</td><td><input type="text" name="email" value="" class="fullW" /></td></tr>';
qq += '			<tr><td class="FBlabel FBlabelCol" style="font-weight: normal;">Your Phone:</td><td><input type="text" name="phone_number" value="" class="fullW" /></td></tr>';
qq += '			<tr><td class="FBlabel FBlabelCol">Your Rate:</td><td class="eOcena0" id="rate_count">';
qq += '<a onclick="setRate(1);return false" onmouseover="setStar(1);return false" onmouseout="backRate();return false" class="FBstarClicker">&nbsp;&nbsp;</a>';
qq += '<a onclick="setRate(2);return false" onmouseover="setStar(2);return false" onmouseout="backRate();return false" class="FBstarClicker">&nbsp;&nbsp;</a>';
qq += '<a onclick="setRate(3);return false"  onmouseover="setStar(3);return false" onmouseout="backRate();return false" class="FBstarClicker">&nbsp;&nbsp;</a>';
qq += '<a onclick="setRate(4);return false"  onmouseover="setStar(4);return false" onmouseout="backRate();return false" class="FBstarClicker">&nbsp;&nbsp;</a>';
qq += '<a onclick="setRate(5);return false"  onmouseover="setStar(5);return false" onmouseout="backRate();return false" class="FBstarClicker">&nbsp;&nbsp;</a>';
qq += '<input type="hidden" name="rate" value="0" id="rate" /><input type="hidden" name="vid" value=""/><input type="hidden" name="url" value=""/>';
qq += '</td></tr>';
qq += '			<tr><td colspan="2" class="FBlabelCol">';
qq += '				Your feedback:<br />';
qq += '				<textarea name="feedback" rows="4" class="fullWplus"></textarea>';
qq += '			</td></tr>';
qq += '			<tr><td colspan="2" class="FBlabel FBlabelCol"><b class="buttons"><a style="font-size:13px;" href="" onclick="submitFeedBack();return false">Send Feedback &raquo;</a></b></td></tr>';
qq += '		</table>';
qq += '		</form>';
qq += '	</div>';
qq += '	<a href="" onclick="showFeedbackForm();return false;" class="FBsendButton" title="Send your feedback to us" onfocus="this.blur();" id="FBsendButton">';
qq += '		<img src="http://www.vemmasuite.com/images/feedback.gif" alt="" border="0" vspace="3" /><br />';
qq += '		Got feedback?';
qq += '	</a>';
qq += '</div>';

// FeedbackForm is causing Planner breakdown
if (typeof DISABLE_FEEDBACK == "undefined"){
	if( lct.indexOf( p+'contact/' ) == -1 && lct.indexOf( p+'contactnew/' ) == -1 ) addEventJS(window, 'load', addFeedbackForm);
}

var target_x = -140;
var target_y = -  65;
has_inner = typeof(window.innerWidth) == 'number';
var has_element = document.documentElement && document.documentElement.clientWidth;
var fm_id='floatFBdiv';
var floating_menu = null;
var fm_shift_x, fm_shift_y, fm_next_x, fm_next_y;

function addFeedbackForm() {
	//document.body.innerHTML += qq;
	var FeedbackDivJS = document.createElement('div');
	FeedbackDivJS.innerHTML = qq;
	document.body.appendChild(FeedbackDivJS);


	floating_menu =
	    document.getElementById
	    ? document.getElementById(fm_id)
	    : document.all
	      ? document.all[fm_id]
	      : document.layers[fm_id];

	compute_shifts();
	if (document.layers) {
	    // Netscape 4 cannot perform init move
	    // when the page loads.
	    fm_next_x = 0;
	    fm_next_y = 0;
	} else {
	    fm_next_x = fm_shift_x + target_x;
	    fm_next_y = fm_shift_y + target_y;
	    move_menu();
	}
	float_menu();


	/**
  * ajaksowy submit formularza feedbacku
  */
  advAJAX.assign(document.getElementById("ObjFeedbackForm"), {
      onSuccess : function(obj) {

        if('1' == obj.responseText){
          resetFeedBackForm();

          showFormMonit('<br /><br /><h4>Thanks for sending this form.</h4>', 10000);
        }
        else {
          showFormMonit('Some error occured. Try once again.', 5000, true);
        }

      },

      onError : function(obj) {
        alert("Error: " + obj.status);
      }
  });

}


function move_menu()
{
    if (document.layers) {
        floating_menu.left = fm_next_x;
        floating_menu.top = fm_next_y;
    } else {
        floating_menu.style.left = fm_next_x + 'px';
        floating_menu.style.top = fm_next_y + 'px';
    }
}

function compute_shifts()
{
    fm_shift_x = has_inner
        ? pageXOffset
        : has_element
          ? document.documentElement.scrollLeft
          : document.body.scrollLeft;

    if (target_x < 0)
        fm_shift_x += has_inner
            ? window.innerWidth
            : has_element
              ? document.documentElement.clientWidth
              : document.body.clientWidth;
    fm_shift_y = has_inner
        ? pageYOffset
        : has_element
          ? document.documentElement.scrollTop
          : document.body.scrollTop;
    if (target_y < 0)
        fm_shift_y += has_inner
            ? window.innerHeight
            : has_element
              ? document.documentElement.clientHeight
              : document.body.clientHeight;
}

function float_menu()
{
    var step_x, step_y;
    compute_shifts();
    step_x = (fm_shift_x + target_x - fm_next_x) * .07;
    if (Math.abs(step_x) < .5) step_x = fm_shift_x + target_x - fm_next_x;
    step_y = (fm_shift_y + target_y - fm_next_y) * .07;
    if (Math.abs(step_y) < .5) step_y = fm_shift_y + target_y - fm_next_y;
    if (Math.abs(step_x) > 0 || Math.abs(step_y) > 0)
    {
        fm_next_x += step_x;
        fm_next_y += step_y;
        move_menu();
    }
    setTimeout('float_menu()', 20);
};

function showFeedbackForm() {
	var fobj=document.getElementById('feedbackForm');
	if( !fobj) return false;
	document.getElementById('formFBtable').style.display = 'block';
    document.getElementById('FBmsg').style.display = 'none';

	fobj.style.display='block';


}

function hideFeedbackForm() {
	var fobj=document.getElementById('feedbackForm');
	if( !fobj) return false;

	fobj.style.display='none';
}

submitFeedBack = function(){
  document.getElementById('FBmsg').style.display = 'block';
  document.getElementById('FBmsg').innerHTML = '<img src="http://www.vemmasuite.com/images/indicator.gif" alt=""  /><br />';
  var error = validFBform();

  document.getElementById("ObjFeedbackForm").elements['url'].value = top.location.href;

  if(error!='') {
		alert("Please correct following errors to send valid form:\n"+error);
		document.getElementById('FBmsg').style.display = 'none';
		return;
	} else{
	  document.getElementById("ObjFeedbackForm").onsubmit();
  }
}

setRate = function(pVal){
  setStar(pVal);

  document.getElementById('rate').value = pVal;
}

setStar = function(pRate){
  document.getElementById('rate_count').className = "eOcena"+pRate;
}

backRate = function(){
  setStar(document.getElementById('rate').value);
}

resetFeedBackForm = function(){
  clearForm(document.forms['ObjFeedbackForm']);
  setRate('0');


}

/**
  * mini console.log czyli wysmienity debugger od FireBuga
  */
if('undefined' == typeof console){
  console = { log: function(pPar){
    var out = pPar;
    if('object' == typeof pPar){
      out = '';
      for(i in pPar){
        out = out +  "[" + i + "] => " + pPar[i] + "\n";
      }
    }
    alert(out);
  }};
}

clearForm = function(pForm){
  for(i in pForm.elements){
    if(pForm.elements && pForm.elements[i] && pForm.elements[i].value){
      pForm.elements[i].value = '';
    }
  }
  pForm.vid.value = "";

  pForm.reset();
}



validFBform = function(){
  var error='';

	var formFBObj = document.forms['ObjFeedbackForm'];
	if(formFBObj.name.value.length==0) error+="- Please enter your name\n";
	if(formFBObj.email.value.length<6 || formFBObj.email.value.indexOf('@')<1 || formFBObj.email.value.indexOf('.')<1) error+="- Please enter valid e-mail address\n";
	if(formFBObj.rate.value.length==0 || '0' == formFBObj.rate.value) error+="- Please enter your rate\n";
	if(formFBObj.feedback.value.length==0) error+="- Please enter your Feedback message\n";

	return error;
}

/**
  * Pokazuje monit na formularzu ,
  *  - pMsg to wiadomosc,
  *  - pDelayInMs to opoznienie schowania,
  *  - pNoHide ustawione true mowi ze ponizej monitu ma byc formularz
  */
showFormMonit = function(pMsg, pDelayInMs, pNoHide){
  document.getElementById('FBmsg').style.display = 'block';
  document.getElementById('FBmsg').innerHTML = pMsg;
  if(!pNoHide){
    document.getElementById('formFBtable').style.display = 'none';
  }


  setTimeout(function() {
    if(!pNoHide){
      document.getElementById('formFBtable').style.display = 'block';
    }
    if('block' == document.getElementById('FBmsg').style.display && !pNoHide){
      hideFeedbackForm();
    }
    document.getElementById('FBmsg').style.display = 'none';
  }, pDelayInMs);
}





