var values = null;
var total_time = false;
var URL = 'http://www.pro.lt/';
//Edit the counter/limiter value as your wish
var countSubject = "150";   //Example: var count = "175";
function limiterSubject(f,l){
var tex = document.myform.f_subject.value;
var len = tex.length;
if(len > countSubject){
		 $('limiterSubject1').style.display = "block";
       $('limiterSubject1').innerHTML = f+" "+len+" "+l+" "+countSubject;

}
else
{
	$('limiterSubject1').style.display = "none";
}
//document.myform.limit_s.value = f+" "+len+" "+l+" "+countSubject;

}
var countText = "1000";   //Example: var count = "175";
function limiterText(f,l){
var tex = document.myform.f_text.value;
var len = tex.length;
/*if(len > countText){
        tex = tex.substring(0,countText);
        document.myform.f_text.value =tex;
        return false;
}*/

var str = "You have typed count characters; the maximum is 200.";
if(len > countText)
{
	 $('limiterText1').style.display = "block";
	$('limiterText1').innerHTML = f+" "+len+" "+l+" "+countText;

}
else
{
	$('limiterText1').style.display = "none";
}
//document.myform.limit_t.value = f+" "+len+" "+l+" "+countText;

}
function addFuncComments(comm,txt)
{
	$('addcommbtn_'+comm).show();
	if( $('comments_'+comm).getValue()==txt )
		$("comments_"+comm).clear();
}
function updatePercent()
{
	SmartyAjax.update('percentprofile', 'ajax/percentprofile.php', 'get', '' );
	return false;
}
function minimizeWin(item)
{
	if( $(item).style.display=='none' )
	{
		$(item).style.display = 'block';
	}
	else
	{
		$(item).style.display = 'none';
	}
}
var countName = "100";   //Example: var count = "175";
function limiterName(f,l){
var tex = document.edit_groups.fld_name.value;
var len = tex.length;
/*if(len > countText){
        tex = tex.substring(0,countText);
        document.myform.f_text.value =tex;
        return false;
}*/

var str = "You have typed count characters; the maximum is 200.";
if(len > countName)
{
	 $('limiterName1').style.display = "block";
	$('limiterName1').innerHTML = f+" "+len+" "+l+" "+countName;

}
else
{
	$('limiterName1').style.display = "none";
}
//document.myform.limit_t.value = f+" "+len+" "+l+" "+countText;

}


var countDesc = "200";   //Example: var count = "175";
function limiterDesc(f,l){
var tex = document.edit_groups.fld_desc.value;
var len = tex.length;
/*if(len > countText){
        tex = tex.substring(0,countText);
        document.myform.f_text.value =tex;
        return false;
}*/

var str = "You have typed count characters; the maximum is 200.";
if(len > countDesc)
{
	 $('limiterDesc1').style.display = "block";
	$('limiterDesc1').innerHTML = f+" "+len+" "+l+" "+countDesc;

}
else
{
	$('limiterDesc1').style.display = "none";
}
//document.myform.limit_t.value = f+" "+len+" "+l+" "+countText;

}

var arrImg = new Array();
	arrImg['image_default'] = new Object();
	//arrImg['image_default_basictop'] = 'true';
	arrImg['image_1'] = new Object();
	arrImg['image_32768'] = new Object();
	arrImg['image_default_basicbox'] = new Object();
	arrImg['image_2'] = new Object();
	arrImg['image_4'] = new Object();
	arrImg['image_8'] = new Object();
	arrImg['image_default_basicmore'] = new Object();
	arrImg['image_16384']  = new Object();
	arrImg['image_64'] = new Object();
	arrImg['image_128']  = new Object();
	arrImg['image_512']  = new Object();
	arrImg['image_1024']  = new Object();
	arrImg['image_2048']  = new Object();
	arrImg['image_4096'] = new Object();
	arrImg['image_16'] = new Object();
	arrImg['image_8192'] = new Object();
	arrImg['image_32']  = new Object();
function gotoURL(url)
{
	window.location = URL + url;
}
function openPolitic()
{
	window.open ("http://www.pros.lt/politic.html","mywindow","menubar=0,resizable=0,width=400,height=500");
}
function openPopupWindow( name_window )
{
	window.open ("http://www.pros.lt/popup/" + name_window + ".html","mywindow","menubar=0,resizable=0,width=450,height=600,scrollbars=1");
}
function changePosition(_this)
{
	var posid = _this.value;
	showLoad();
	SmartyAjax.update('business_details', 'index.php', 'get', 'page=position&module=myprofile&f=editPosition&change=combo&id_pos='+posid );
	return false;
	//SmartyAjax.update('business_details', 'index.php', 'get', 'page=position&module=myprofile&f=editPosition&id_pos={$item.id}'); return false;
}
var DivParmyid = "";
var DivParsessid = "";
var DivPar_id = "";
var DivParnotknowusers = "";
var DivElementMain="";
var TimeToFade = 1000.0;
function animateFade(lastTick, eid)
{
  var curTick = new Date().getTime();
  var elapsedTicks = curTick - lastTick;

  var element = document.getElementById(eid);

  if(element.FadeTimeLeft <= elapsedTicks)
  {
    element.style.opacity = element.FadeState == 1 ? '1' : '0';
    element.style.filter = 'alpha(opacity = '
        + (element.FadeState == 1 ? '100' : '0') + ')';
    element.FadeState = element.FadeState == 1 ? 2 : -2;
    return;
  }

  element.FadeTimeLeft -= elapsedTicks;
  var newOpVal = element.FadeTimeLeft/TimeToFade;
  if(element.FadeState == 1)
    newOpVal = 1 - newOpVal;

  element.style.opacity = newOpVal;
  element.style.filter = 'alpha(opacity = ' + (newOpVal*100) + ')';

  setTimeout("animateFade(" + curTick + ",'" + eid + "')", 33);
}
function fade(eid)
{
  var element = document.getElementById(eid);
  if(element == null)
    return;

  if(element.FadeState == null)
  {
    if(element.style.opacity == null
        || element.style.opacity == ''
        || element.style.opacity == '1')
    {
      element.FadeState = 2;
    }
    else
    {
      element.FadeState = -2;
    }
  }

  if(element.FadeState == 1 || element.FadeState == -1)
  {
    element.FadeState = element.FadeState == 1 ? -1 : 1;
    element.FadeTimeLeft = TimeToFade - element.FadeTimeLeft;
  }
  else
  {
    element.FadeState = element.FadeState == 2 ? -1 : 1;
    element.FadeTimeLeft = TimeToFade;
    setTimeout("animateFade(" + new Date().getTime() + ",'" + eid + "')", 33);
  }
}
function divanimation( )
{

	var DivElement = $('notKnow_'+DivPar_id);

	var DivElementHeight = DivElement.getHeight()-2;//DivElement.clientHeight-2;
	DivElement.setStyle({height: DivElementHeight});
	DivElement.style.height = DivElementHeight + 'px';
//	alert(DivElement.style.height);

	//alert(gInt);

	if( DivElementHeight>1 )
		setTimeout('divanimation()',1);
	else
	{
		DivElement.innerHTML = '';
		if( gInt>4 )
		{
			DivElement.setStyle({height: 'auto'});
		}


		SmartyAjax.update('notKnow_'+DivPar_id, 'ajax/notknow2.php', 'get', 'uid='+DivParmyid+'&sessid='+DivParsessid+'&divid='+DivPar_id+'&notknowusers='+lasusersid+'&allcount='+countmayknow );
		if( gInt==0 )
		{
			$("peopleYouKnowWin").style.display='none';
			return false;
		}
		return false;
	}

}
var DivParmyidj = "";
var DivParsessidj = "";
var DivPar_idj = "";
var DivParnotknowusersj = "";
var DivElementMainj="";
var gIntj = null;
var lasusersidj = null;
function divanimationj( )
{
	var DivElement = $('itemJoin_'+DivPar_idj);
	//var DivElementHeight = DivElement.getHeight()-2;//DivElement.clientHeight-2;

	var DivElementHeight = DivElement.getHeight()-2;//DivElement.clientHeight-2;
	DivElement.setStyle({height: DivElementHeight});
	DivElement.style.height = DivElementHeight + 'px';

	//alert(DivElement.getHeight());

	if( DivElementHeight>1 )
	{
		setTimeout('divanimationj()',1);
	}
	else
	{
		DivElement.innerHTML = '';

		if( gIntj>4 )
		{
			//DivElement.style.height = 'auto';
			DivElement.setStyle({height: 'auto'});
		}



		SmartyAjax.update('itemJoin_'+DivPar_idj, 'ajax/mostJoin.php', 'get', 'uid='+DivParmyidj+'&sessid='+DivParsessidj+'&divid='+DivPar_idj+'&notknowusers='+lasusersidj );
		if( gIntj==0 )
		{
			$("most_join").style.display='none';
			return false;
		}
		return false;
	}

}
function closeWindow(elemID)
{
	$(elemID).hide();
	if( $(elemID)!=null )
	$(elemID).style.display = "none";
	SmartyAjax.update(elemID+'', 'ajax/closeWindow.php', 'get', 'winname='+elemID );
}
function mostJoin(  myid, sessid, _id,notknowusers  )
{
	/*if( $("endofgroupjoin")==null || $("endofgroupjoin")=='undefined' )
		SmartyAjax.update('itemJoin_'+_id, 'ajax/mostJoin.php', 'get', 'uid='+myid+'&sessid='+sessid+'&divid='+_id+'&notknowusers='+$("lasusersid").value );
	else
	{
		$("most_join").style.display = 'none';
	}*/

	DivParmyidj = myid;
	DivParsessidj = sessid;
	DivPar_idj = _id;
	DivParnotknowusersj = notknowusers;
	DivElementMainj = $('itemJoin_'+DivPar_idj).getHeight();//$('itemJoin_'+DivPar_idj).clientHeight;
	$("lasusersidj").value = '';



	for( var j=1;j<6;j++ )
	{
		if( $('notKnowGroup_'+j)!=null )
		{
			if($("lasusersidj").value=="")
				$("lasusersidj").value = $('notKnowGroup_'+j).value;
			else
				$("lasusersidj").value = $("lasusersidj").value+","+$('notKnowGroup_'+j).value;

			if( $('notKnowGroup1_'+j)!=null )
			{
				if($("lasusersidj").value=="")
					$("lasusersidj").value = $('notKnowGroup1_'+j).innerHTML;
				else
					$("lasusersidj").value = $("lasusersidj").value+","+$('notKnowGroup1_'+j).innerHTML;
			}
		}
	}
	$("lasusersidj").value = $("lasusersidj").value+","+myid;



	gIntj = parseInt($("count_groupj").value);
	lasusersidj = $("lasusersidj").value;
	gIntj--;
	$("count_groupj").value = gIntj;
	setTimeout('divanimationj()',1);

	return false;
}
var gInt = null;
var lasusersid = null;
var countmayknow = 0;
function notKnow( myid, sessid, _id,notknowusers )
{

	DivParmyid = myid;
	DivParsessid = sessid;
	DivPar_id = _id;
	DivParnotknowusers = notknowusers;
	DivElementMain = $('notKnow_'+DivPar_id).getHeight();//$('notKnow_'+DivPar_id).clientHeight;
	$("lasusersid").value = '';
	countmayknow = 0;
	for( var j=1;j<6;j++ )
	{
		if( $('notKnowUser_'+j)!=null )
		{
			if($("lasusersid").value=="")
				$("lasusersid").value = $('notKnowUser_'+j).value;
			else
				$("lasusersid").value = $("lasusersid").value+","+$('notKnowUser_'+j).value;

			countmayknow = parseInt(countmayknow)+1;
		}

	}
	$("lasusersid").value = $("lasusersid").value+","+myid;
	gInt = parseInt($("count_peoplemayknow").value);
	lasusersid = $("lasusersid").value;
	gInt--;
	$("count_peoplemayknow").value = gInt;
	setTimeout('divanimation()',1);

	return false;
}
function delEvents(txt)
{
	if ( confirm(txt) )
	{
		return true;
	}
	else
		return false;
}
function popup(mylink, windowname)
{

if (! window.focus)return true;
var href;

if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=500,height=300,scrollbars=no');
return false;
}
function submitAddTheme2()
{

	var bool1 = false;
	var bool2 = false;

	if( document.getElementById("f_subject1")!=null )
	{

	if( document.getElementById("f_subject1").value=="" )
	{
		document.getElementById("subjError1").style.display="block";
		bool1 = true;
	}
	else
		document.getElementById("subjError1").style.display="none";
	}

	if( document.getElementById("f_text1").value=="" )
	{
		document.getElementById("textError1").style.display="block";
		bool2 = true;
	}
	else
		document.getElementById("textError1").style.display="none";

	if( document.getElementById("code_error1")!=null )
	document.getElementById("code_error1").style.display="none";




	if( bool1==false && bool2==false )
	{
		return true;
		//document.registration.submit();
	}

	return false;
}
function submitAddTheme1()
{

	var bool1 = false;
	var bool2 = false;

	if( document.getElementById("f_subject")!=null )
	{

	if( document.getElementById("f_subject").value=="" )
	{
		document.getElementById("subjError").style.display="block";
		bool1 = true;
	}
	else
		document.getElementById("subjError").style.display="none";
	}

	if( document.getElementById("f_text").value=="" )
	{
		document.getElementById("textError").style.display="block";
		bool2 = true;
	}
	else
		document.getElementById("textError").style.display="none";

	if( document.getElementById("code_error")!=null )
	document.getElementById("code_error").style.display="none";

	if( $('limiterText1').innerHTML!="" )
	{
		bool1 = true;
	}
	if( $('limiterSubject1').innerHTML!="" )
	{
		bool1 = true;
	}

	if( bool1==false && bool2==false )
	{
		return true;
		//document.registration.submit();
	}

	return false;
}
function submitAddTheme()
{

	var bool1 = false;
	var bool2 = false;

	if( document.getElementById("f_subject")!=null )
	{

	if( document.getElementById("f_subject").value=="" )
	{
		document.getElementById("subjError").style.display="block";
		bool1 = true;
	}
	else
		document.getElementById("subjError").style.display="none";
	}

	if( document.getElementById("f_text").value=="" )
	{
		document.getElementById("textError").style.display="block";
		bool2 = true;
	}
	else
		document.getElementById("textError").style.display="none";

	if( document.getElementById("code_error")!=null )
	document.getElementById("code_error").style.display="none";

	if( document.getElementById("signature_2")!=null )
	{
		if( document.getElementById("signature_2").checked==true && document.getElementById("code_error")!=null 	 )
		{
			var code1 = document.getElementById("enter_code").value;
			var code2 = document.getElementById("code").value;
			code1 = code1.toLowerCase();
			code2 = code2.toLowerCase();
			if( document.getElementById("enter_code").value=="" || code1!=code2 )
			{
				document.getElementById("code_error").style.display="block";
				bool2 = true;
			}
			else
				document.getElementById("code_error").style.display="none";


		}
	}


	if( bool1==false && bool2==false )
	{
		document.registration.submit();
		return true;
	}

	return false;
}
function showAllElement(elements)
{
	var el = $(elements).getElementsByClassName("rowsitems");
	for( i in el )
		el[i].show();

}
function addShareComments( shareid )
{

	var error = false;
		var id = 0;
	if( $("comments_"+shareid).getValue()=="" )
	{
		$("error_comm").show();
		return false;
	}
	else
	{
		$("error_comm").hide();
	}
		rules = {
		params: function() {
				return {
					srd_comments: $F("comments_"+shareid),
					srd_shareid:shareid
				}
			},

			cb: function(originalRequest) {
				var resultRequest = new String(originalRequest.responseText);

				$("comments_"+shareid).setValue("");
				if( resultRequest!="" )
				{

					/*$("sharelist_title").show();*/
					/*var my_div = document.createElement('div');
					my_div.setAttribute('id','sharelist'+resultRequest);

					my_div.style.padding = "0px";
					my_div.style.textAlign = "left";
					my_div.style.margin = "0px";
					my_div.style.height = "auto";

					$("sharelist_"+shareid).appendChild(my_div);*/
					$("sharelist_"+shareid).insert({'top':new Element('div', { id: 'sharelist'+resultRequest })});
					$('sharelist'+resultRequest).setStyle({padding:"0px",textAlign:"left",margin:"0px",height:"auto"});

					if( $("myreplay").getValue()=="1" )
						var myreplay = 1;
					else
						var myreplay = 0;


					SmartyAjax.update('sharelist'+resultRequest, 'ajax/sharelist.php', 'get', 'sharecommid='+resultRequest+'&myreplay='+myreplay );
					return false;
				}

			}
		}


		SmartyAjax.call('ajax/sharelist.php', 'get', '', rules.cb, rules.params);
}
function showReplayShare(userid,name)
{
	$('upd_subject').setValue("Re:"+name);
	$('upd_msg').setValue("\n\n>>"+$("regarding").getValue()+" "+name);
	$('upd_userid').setValue(userid);
	$('addreplay').show();
}
function sendMessagePrivate()
{

	var error = false;
		var id = 0;
	if( $('upd_msg').getValue()=="" )
	{
		$("error_commp").show();
		return false;
	}
	else
	{
		$("error_commp").hide();
	}
	if( $('upd_subject').getValue()=="" )
	{
		$("error_subjectp").show();
		return false;
	}
	else
	{
		$("error_subjectp").hide();
	}

		rules = {
		params: function() {
				return {
					rpl_msg: $F("upd_msg"),
					rpl_subject: $F("upd_subject"),
					rpl_userid:$F("upd_userid")
				}
			},

			cb: function(originalRequest) {
				var resultRequest = new String(originalRequest.responseText);
				if( resultRequest=="ok" )
				{
					$('addreplay').hide('slow');
					$('error_sendmail').show();
				}
			}
		}


		SmartyAjax.call('ajax/sendmessages.php', 'get', '', rules.cb, rules.params);
}
function addShare()
{

	var error = false;
		var id = 0;

		rules = {
		params: function() {
				return {
					sharetxt: $F("share")
				}
			},

			cb: function(originalRequest) {
				var resultRequest = new String(originalRequest.responseText);

				if( resultRequest!="" )
				{
					

					$("share").setValue("");
					
					$("sharelist_title").show();
					var my_div = document.createElement('div');
					my_div.setAttribute('id','sharelist'+resultRequest);


					$("sharelist_title").update('');
					$("sharelist_title").innerHTML;


					$("sharelist_title").appendChild(my_div);

					if( $("showinprofile").getValue()=="1" )
						var showinprofile = 1;
					else
						var showinprofile = 0;

					SmartyAjax.update('sharelist_title', 'ajax/sharelist.php', 'get', 'shareid='+resultRequest+'&showinprofile='+showinprofile );
					return false;
				}

			}
		}


		SmartyAjax.call('ajax/sharelist.php', 'get', '', rules.cb, rules.params);
}
function submitAddThemes(before, forum_id, theme_id, group_name)
{
	showAccept();
	SmartyAjax.update('md_show', before+'index.php', 'get', 'module=groups&f=add_themes&theme_id='+theme_id+'&forum_id='+forum_id+'&groups_name=' + group_name );
	return false;
}
function submitAddComment(before, forum_id, theme_id, group_name,type)
{
	showAccept();
	SmartyAjax.update('md_show', before+'index.php', 'get', 'module=groups&f=add_comment&theme_id='+theme_id+'&forum_id='+forum_id+'&groups_name=' + group_name + '&ctype='+type );
	return false;
}
function gotomyURL(url)
{
	var myurl = new String(window.location);
	if( myurl.indexOf("?")==-1 )
		window.location = window.location+"?lang="+url;
	else
		window.location = window.location+"&lang="+url;
}
function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return scrOfY;
}
function cancelAlert()
{
	$("md_show").style.display = 'none';
	$("md_show").className = "";

	if( $("pos_txt")!=null )
	$("pos_txt").style.display = 'none';

	if( $("edu_txt")!=null )
	$("edu_txt").style.display = 'none';

	if($("delThisEduID")!=null)
	$("delThisEduID").value = "";

	if($("delThisPosID")!=null)
	$("delThisPosID").value = "";

	if($("delThisRecID")!=null)
	$("delThisRecID").value = "";

}
function showAlertBusiness( id )
{
	$("md_show").style.display = 'block';
	$("md_show").className = "modal-dialog modal-show";
	$("action_delete").value = id;
}
function showAlert(what,id)
{
	$("md_show").style.display = 'block';
	$("md_show").className = "modal-dialog modal-show";
	if( what=='position' )
	{
		if( $("pos_txt")!=null )
			$("pos_txt").style.display = 'block';

		if( $("edu_txt")!=null )
			$("edu_txt").style.display = 'none';

		if( $("rec_txt")!=null )
			$("rec_txt").style.display = 'none';


		$("delThisPosID").value = id;
		$("delThisEduID").value = "";
		$("delThisRecID").value = "";
	}

	if( what=='education' )
	{
		if( $("pos_txt")!=null )
			$("pos_txt").style.display = 'none';

		if( $("rec_txt")!=null )
			$("rec_txt").style.display = 'none';

		if( $("edu_txt")!=null )
			$("edu_txt").style.display = 'block';


		$("delThisEduID").value = id;
		$("delThisPosID").value = "";
		$("delThisRecID").value = "";
	}

	if( what=='rec' )
	{
		$("delThisRecID").value = id;

		if( $("pos_txt")!=null )
			$("pos_txt").style.display = 'none';

		if( $("rec_txt")!=null )
			$("rec_txt").style.display = 'block';

		if( $("edu_txt")!=null )
			$("edu_txt").style.display = 'none';


		$("delThisEduID").value = "";
		$("delThisPosID").value = "";


	}

	if( what=='invite' )
	{
		if( $("delThisID")!=null )
			$("delThisID").value = id;

		if( $("pos_txt")!=null )
			$("pos_txt").style.display = 'block';

		if( $("rec_txt")!=null )
			$("rec_txt").style.display = 'none';

		if( $("edu_txt")!=null )
			$("edu_txt").style.display = 'none';
	}
	if( what=='message' )
	{
		$("delThisID").value = id;
	}
	if( what=='job' )
	{
		$("delThisID").value = id;
	}

	if( what=='intro' )
	{
		$("delThisIntroID").value = id;
		$("declineForward").value = 1;
	}
	if( what=='introduction' )
	{
		$("delThisIntID").value = id;
		$("declineForward").value = 0;
	}
}
function changeLang()
{
	if( $('language_').value=="lt" )
	{
		$('fld_subject').value = $('sbj_lt').value;
		$('fld_greeting').value = $('body_lt').value;
	}

	if( $('language_').value=="en" )
	{
		$('fld_subject').value = $('sbj_en').value;
		$('fld_greeting').value = $('body_en').value;
	}
}
function changeLang1()
{
	if( $('language_').value=="lt" )
	{
		$('subject-invitation').value = $('sbj_lt').value;
		$('greeting-invitation').value = $('body_lt').value;
	}

	if( $('language_').value=="en" )
	{
		$('subject-invitation').value = $('sbj_en').value;
		$('greeting-invitation').value = $('body_en').value;
	}
}
function showMenu(iter)
{
	if( $( "nav-prim-1" )!=null  )
		$( "nav-prim-1" ).style.display = 'block';
	if( $( "nav-prim-3" )!=null  )
		$( "nav-prim-3" ).style.display = 'block';

	if( $( "nav-prim-2" )!=null  )
		$( "nav-prim-2" ).style.display = 'block';
	if( $( "nav-prim-4" )!=null  )
		$( "nav-prim-4" ).style.display = 'block';



	var key = "";
	if( $("show_rec_name").value!="" )
		key = $("show_rec_name").value;

	if( $(key)!=null )
	{
		$(key).className = '';
	}

	if( key!="rez-" + iter )
	{
		$("rez-" + iter).className = 'open';
		$("show_rec_name").value = "rez-" + iter;

		var k2 = parseInt( iter ) + 1;
		if( $( "nav-prim-" + k2 )!=null  )
			$( "nav-prim-" + k2 ).style.display = 'none';

	}
	else
	{
		$("show_rec_name").value = "";
		var k2 = parseInt( iter ) + 1;
		if( $( "nav-prim-" + k2 )!=null  )
			$( "nav-prim-" + k2 ).style.display = 'block';
	}



}
function changeBg(_this,bool,fill)
{
	if( bool==1 )
	{
		_this.style.backgroundColor = "#F6FBFF";
	}
	else
	{
		if( fill%2>0 )
			_this.style.backgroundColor = "#FAFAFA";
		else
			_this.style.backgroundColor = "#FFFFFF";


	}
}
function changeBgJob(_this,bool,fill)
{
	if( bool==1 )
	{
		_this.style.backgroundColor = "#F6FBFF";
		if( $("borderNoneLogo_"+fill)!=null )
		{
			$("borderNoneLogo_"+fill).style.display = "none";
			$("borderLogo_"+fill).style.display = "block";
		}
	}
	else
	{
		if( fill%2>0 )
			_this.style.backgroundColor = "#FAFAFA";
		else
			_this.style.backgroundColor = "#FFFFFF";

		if( $("borderNoneLogo_"+fill)!=null )
		{
			$("borderNoneLogo_"+fill).style.display = "block";
			$("borderLogo_"+fill).style.display = "none";
		}
	}

}
function chechRules(this_)
{
	if( this_.value=="break" )
	{
		this_.value = "ak";
	}
	if( this_.value=="other" )
	{
		$("other_city").style.display = "block";
	}
	else
	{
		$("other_city").style.display = "none";
	}

}
function checkFields()
{
	for( i in document.getElementById("register") )
	{
		if( document.getElementById("register")[i]!=undefined && document.getElementById("register")[i].type=='text' )
		{
			if( document.getElementById("register")[i].value == "")
			{
				alert("All fields should beat are filled");
				document.getElementById("register")[i].focus();
				return false;
			}
		}
	}

	if( document.getElementById("fld_password").value!=document.getElementById("tmp_password1").value )
	{
		alert("Password error");
		return false;
	}
	return true;
}

function editExperience(id)
{
	SmartyAjax.update('errorDiv', SUB_+'index.php', 'get', 'module=myprofile&f=nullErrors');
	SmartyAjax.update('business_details', SUB_+'index.php', 'get', 'posID='+id+'&module=myprofile&f=addPosition');
	return false;
}
function declareProfile(page)
{
	//SmartyAjax.update('errorDiv', SUB_+'index.php', 'get', 'module=myprofile&f=nullErrors');
	SmartyAjax.update('main', SUB_+'index.php', 'get', 'module=myprofile&f=declareProfile&pg='+page);
	return false;
}
function showImage()
{
	SmartyAjax.update('main', SUB_+'index.php', 'get', 'module=myprofile&f=uploadFileSchool1&page=upload');
	return false;
}
function recommendEndorse(id)
{
	//SmartyAjax.update('errorDiv', SUB_+'index.php', 'get', 'module=myprofile&f=nullErrors');
	SmartyAjax.update('main_left', SUB_+'index.php', 'get', 'module=myprofile&f=recommendEndorse&id='+id);
	SmartyAjax.update('connection_list', SUB_+'index.php', 'get', 'module=myprofile&f=showList&id='+id);
	return false;
}
function editPhoto()
{
	//onClick="{ajax_update update_id='main' function='uploadPhoto' params='page=upload&module=myprofile'}"
	SmartyAjax.update('main_left', SUB_+'index.php', 'get', 'module=myprofile&f=editPhoto');
	return false;
}
function submitEvent()
{
	document.eventForm.submit();
}
function showPreloader()
{
	$("main_left").innerHTML = "";
}
function showMainPage(val,forum_id,theme_id,body)
{
	if( body=="" )
	{
		if( forum_id=="" && theme_id=="" )
			SmartyAjax.update('main_left', './../../index.php', 'get', 'module=groups&f=start_page&groups_name='+val);

		if( forum_id!="" && theme_id=="" )
			SmartyAjax.update('main_left', './../../../index.php', 'get', 'module=groups&f=show_themes&forum_id='+forum_id+'&groups_name='+val);

		if( forum_id!="" && theme_id!="" )
			SmartyAjax.update('main_left', './../../../index.php', 'get', 'module=groups&f=show_comments&forum_id='+forum_id+'&groups_name='+val+'&theme_id='+theme_id);
	}
	else
	{
		//submitAddComment('./../../',forum_id,theme_id,val);
		SmartyAjax.update('main_left', './../../../index.php', 'get', 'module=groups&f=add_themes&forum_id='+forum_id+'&groups_name='+val+'&theme_id='+theme_id);
	}

	return false;
}
function showAccept()
{
	if( document.getElementById("md_show")!=null )
		document.getElementById("md_show").className = "modal-dialog modal-show";
			//document.getElementById("overlay").className = "modal-show";
}
function hideAccept()
{
	if( document.getElementById("md_show")!=null )
	{
		document.getElementById("md_show").className = "";
		document.getElementById("md_show").style.display = "none";
	}
	document.getElementById("md_show").innerHTML = "";
			//document.getElementById("overlay").className = "modal-show";
}
//show profile -> business details
function showBusiness(u_,val)
{
	SmartyAjax.update('main_left', u_+'index.php', 'get', 'module=myprofile&f=business_details&profile='+val);
	return false;
}
//show profile -> contacts
function showMyContacts(u_,val)
{
	SmartyAjax.update('main_left', u_+'index.php', 'get', 'module=myprofile&f=contacts_details&profile='+val);
	return false;
}
//show profile -> about as
function showAbout(u_,val)
{
	SmartyAjax.update('main_left', u_+'index.php', 'get', 'module=myprofile&f=about_details&profile='+val);
	return false;
}
function saveImage(name)
{
	var _width = document.getElementById("width").value;
	var _height = document.getElementById("height").value;
	var _x1 = document.getElementById("x1").value;
	var _y1 = document.getElementById("y1").value;

	closeImage();
	SmartyAjax.update('main', SUB_+'index.php', 'get', 'module=myprofile&f=uploadPicture&page=upload&name='+name+"&x1="+_x1+"&y1="+_y1+"&width="+_width+"&height="+_height);
	return false;
}
function saveLogo(name)
{
	var _width = document.getElementById("width").value;
	var _height = document.getElementById("height").value;
	var _x1 = document.getElementById("x1").value;
	var _y1 = document.getElementById("y1").value;

	//alert(_width+"  "+_height+"  "+_x1+"  "+_y1);
	if( _width=='0' || _height=='0' )
	{
		_width = $("testImage").width;
		_height = $("testImage").height;
	}
	closeImage();
	SmartyAjax.update('show_logo', SUB_+'index.php', 'get', 'module=job&f=uploadLogo&name='+name+"&x1="+_x1+"&y1="+_y1+"&width="+_width+"&height="+_height);
	return false;
}
function loadImage()
{
	$("profile-picture-dialog").style.height = $("testImage").height + 135 + "px";
	document.getElementById("upload-progress").style['display'] = 'none';
	document.getElementById("picture-editor").style['display'] = 'block';
}
function checkImportField()
{
	var error = false;
	if( $('fld_passwd').value=="" )
	{
		error = true;
		$("passwdError").style.display = "block";
	}
	else
	{
		$("passwdError").style.display = "none";
	}
	if( $('fld_email').value=="" )
	{
		error = true;
		$("emailError").style.display = "block";
	}
	else
	{
		$("emailError").style.display = "none";
	}


	return error;
}
function checkImport()
{
	var error = false;

	if( $('fld_passwd').value=="" && $('fld_email').value=="" )
	{
		document.getContactsForm.action  = "index.php?module=join&step=3";
		return false;
	}


	return false;
}
function closeImage()
{
	if( document.getElementById("mask")!=null )
		document.getElementById("mask").style['display'] = 'none';

	if( document.getElementById("profile-picture-dialog_c")!=null )
		document.getElementById("profile-picture-dialog_c").style['display'] = 'none';

}
function changeWebmail(val)
  {
  	if( val==0 )
	{
		document.getElementById("email-domain").innerHTML = "@yahoo.com";
		$("name_fld").style.display = "none";
		$("username_fld").style.display = "block";
		if( document.getElementById("import_win")!=null )
			document.getElementById("import_win").style.display = 'block';

		if( document.getElementById("import_win_1")!=null )
		{
			document.getElementById("import_win_1").style.display = 'none';
			document.getElementById("import_win_2").style.display = 'none';
		}

	}

	if( val==1 )
	{
		document.getElementById("email-domain").innerHTML = "@gmail.com";
		$("name_fld").style.display = "none";
		$("username_fld").style.display = "block";
		if( document.getElementById("import_win")!=null )
			document.getElementById("import_win").style.display = 'block';

				if( document.getElementById("import_win_1")!=null )
		{
			document.getElementById("import_win_1").style.display = 'none';
			document.getElementById("import_win_2").style.display = 'none';
		}

	}

	if( val==2 )
	{
		document.getElementById("email-domain").innerHTML = "@hotmail.com";
		$("name_fld").style.display = "none";
		$("username_fld").style.display = "block";
		if( document.getElementById("import_win")!=null )
			document.getElementById("import_win").style.display = 'block';

				if( document.getElementById("import_win_1")!=null )
		{
			document.getElementById("import_win_1").style.display = 'none';
			document.getElementById("import_win_2").style.display = 'none';
		}

	}

	if( val==3 )
	{
		document.getElementById("email-domain").innerHTML = "";
		$("name_fld").style.display = "block";
		$("username_fld").style.display = "none";
		if( document.getElementById("import_win")!=null )
			document.getElementById("import_win").style.display = 'block';

		if( document.getElementById("import_win_1")!=null )
		{
			document.getElementById("import_win_1").style.display = 'none';
			document.getElementById("import_win_2").style.display = 'none';
		}

	}

	if( val==4 )
	{
		if( document.getElementById("import_win")!=null )
			document.getElementById("import_win").style.display = 'none';

		if( document.getElementById("import_win_1")!=null )
		{
			document.getElementById("import_win_1").style.display = 'block';
			document.getElementById("import_win_2").style.display = 'block';
		}

		$("name_fld").style.display = "block";
		$("username_fld").style.display = "none";

	}


  }
  function addMoreFields(num)
  {
  		if( document.getElementById("my"+num+"Div")==null )
			addEvent(num);
  }
  function addEvent(num) {
  	var ni = document.getElementById('myDiv');
  	var numi = document.getElementById('theValue');
  	//var num = (document.getElementById("theValue").value -1)+ 2;
  	numi.value = num;
  	var divIdName = "my"+num+"Div";
  	var newdiv = document.createElement('div');
  	newdiv.setAttribute("id",divIdName);

  	newdiv.innerHTML = "<div><div style=\"width:130px;float:left;\"><input name=\"usr"+num+"_firstName\" value=\"\" id=\"usr"+num+"_firstName\" size=\"12\" maxlength=\"20\" style=\"width:125px;\" class=\"first\" type=\"text\"></div><div style=\"width:130px;float:left;padding-left:5px;\"><input name=\"usr"+num+"_lastName\" value=\"\" id=\"usr"+num+"_lastName\" size=\"12\" maxlength=\"40\" style=\"width:125px;\" type=\"text\"></div><div style=\"width:200px;float:left;padding-left:5px;\"><input  onKeyUp=\"javascript:addMoreFields('"+(parseInt(num)+1)+"');\" name=\"usr"+num+"_recipientEmail\" value=\"\" id=\"usr"+num+"_recipientEmail\" size=\"24\" maxlength=\"128\" style=\"width:190px;\" type=\"text\"></div></div>";
  	ni.appendChild(newdiv);
}

function removeElement(divNum) {
  	var d = document.getElementById('myDiv');
  	var olddiv = document.getElementById(divNum);
  	d.removeChild(olddiv);
}
function checkFieldsLogin()
{
	for( i in document.getElementById("admin") )
	{
		if( document.getElementById("admin")[i]!=undefined && document.getElementById("admin")[i].type=='text' )
		{
			if( document.getElementById("admin")[i].value == "")
			{
				alert("All fields should beat are filled");
				document.getElementById("admin")[i].focus();
				return false;
			}
		}
	}
	return true;
}
function showUniver(_this,module)
{
	var str = _this.value;
	SmartyAjax.update('univer-ac', SUB_+'quick.php', 'get', '&module='+module+'&f=update_listUniver&univer=' + str+'&country=' + $('fld_schoolcountryCode').value);
	return false;
}
function showCompany(_this,module)
{
	var str = _this.value;
	SmartyAjax.update('company-ac', SUB_+'quick.php', 'get', '&module='+module+'&f=update_listCompany&company=' + str);
	return false;
}
function changeCountry(module)
{
	if( $("fld_schoolcountryCode").value!=''  )
	{
		$("row-school").style.display = "block";
		if( $("all_dates")!=null )
		$("all_dates").style.display = "block";
	}
	else
	{
		$("row-school").style.display = "none";
		if( $("all_dates")!=null )
		$("all_dates").style.display = "none";
	}

	$("fld_schoolName").value = "";

	/*var country = document.getElementById("fld_schoolcountryCode").value;

	SmartyAjax.update('row-province', SUB_+'index.php', 'get', 'page=comboState&module='+module+'&f=update_comboState&country='+country+'');
	SmartyAjax.update('row-school', SUB_+'index.php', 'get', 'page=comboSchool&module='+module+'&f=update_comboSchool&country='+country+'');
	return false;*/
}
function removeAutoUniver()
{
	$('univer-ac').innerHTML='';
}
function remoreAuto()
{
	$('company-ac').innerHTML='';
}
function showWinDay( _this , key , key1 )
{

	//if( $( $( "selEventID" ).value ) != null )
		//$( $( "selEventID" ).value ).style.backgroundColor = "#FFFFFF";

	if( $("eventID").value == _this.name )
	{
		$( "event_win" ).style.display = "none";
		$( "eventID" ).value = "";
		$( "selEventID" ).value = "";
		//if( $( "day_" + key + "_" + key1 )!=null )
		//$( "day_" + key + "_" + key1 ).style.backgroundColor = "#FFFFFF";

	}
	else
	{
		if( $("eventID").value == "" )
		{
			if( $( "event_win" ).style.display == "block" )
			{
				$( "event_win" ).style.display = "none";
				$( "eventID" ).value = "";
				$( "selEventID" ).value = "";
				//if( $( "day_" + key + "_" + key1 )!=null )
				//$( "day_" + key + "_" + key1 ).style.backgroundColor = "#FFFFFF";

			}
			else
			{
				$( "event_win" ).style.display = "block";
				$( "eventID" ).value = _this.name;
				$( "selEventID" ).value = "day_" + key + "_" + key1;
				//if( $( "day_" + key + "_" + key1 )!=null )
				//$( "day_" + key + "_" + key1 ).style.backgroundColor = "#F1F1F1";

			}
		}
		else
		{
			$( "eventID" ).value = _this.name;
			$( "selEventID" ).value = "day_" + key + "_" + key1;
			//if( $( "day_" + key + "_" + key1 )!=null )
			//$( "day_" + key + "_" + key1 ).style.backgroundColor = "#F1F1F1";
		}
	}


	$( "event_win" ).style.top = ""+ (yMousePos - 200) +"px";
	$( "event_win" ).style.left = ""+ xMousePos +"px";
}
function showWin( _this , key , key1 )
{

	var str = $( "selEventID" ).value;


	if( str!="" && $( str ) != null )
	{
		if( str.indexOf("day")==-1 )
		$( $( "selEventID" ).value ).style.backgroundColor = "#FFFFFF";
	}

	if( $("eventID").value == _this.name )
	{
		$( "event_win" ).style.display = "none";
		$( "eventID" ).value = "";
		$( "selEventID" ).value = "";
		if( $( "td_" + key + "_" + key1 )!=null )
		$( "td_" + key + "_" + key1 ).style.backgroundColor = "#FFFFFF";

	}
	else
	{
		if( $("eventID").value == "" )
		{
			if( $( "event_win" ).style.display == "block" )
			{
				$( "event_win" ).style.display = "none";
				$( "eventID" ).value = "";
				$( "selEventID" ).value = "";
				if( $( "td_" + key + "_" + key1 )!=null )
				$( "td_" + key + "_" + key1 ).style.backgroundColor = "#FFFFFF";

			}
			else
			{
				$( "event_win" ).style.display = "block";
				$( "eventID" ).value = _this.name;
				$( "selEventID" ).value = "td_" + key + "_" + key1;
				if( $( "td_" + key + "_" + key1 )!=null )
				$( "td_" + key + "_" + key1 ).style.backgroundColor = "#F1F1F1";

			}
		}
		else
		{
			$( "eventID" ).value = _this.name;
			$( "selEventID" ).value = "td_" + key + "_" + key1;
			if( $( "td_" + key + "_" + key1 )!=null )
			$( "td_" + key + "_" + key1 ).style.backgroundColor = "#F1F1F1";
		}
	}

	$( "event_win" ).style.top = ""+ (yMousePos - 200) +"px";
	$( "event_win" ).style.left = ""+ xMousePos +"px";


}
function changeBody(day,month,year,type)
{
	SmartyAjax.update('calendar_main', SUB_+'index.php?module=calendar', 'get', 'page=comboState&module=calendar&f=showBodyCalendar&year=' + year + '&month=' + month + '&type='+type+ '&day='+day+'&sel_day='+$("sel_day").value+'&sel_month='+$("sel_month").value+'&sel_year='+$("sel_year").value);
	return false;
}
function changeMonth(month,year,way,day)
{
	SmartyAjax.update('calendar', SUB_+'index.php', 'get', 'page=comboState&module=calendar&f=showCalendar&year=' + year + '&month=' + month + '&way='+way+ '&day='+day+'&sel_day='+$("sel_day").value+'&sel_month='+$("sel_month").value+'&sel_year='+$("sel_year").value+'&type='+$("type").value);

	if( way=='2' )
		SmartyAjax.update('calendar_main', SUB_+'index.php?module=calendar', 'get', 'page=comboState&module=calendar&f=showBodyCalendar&year=' + year + '&month=' + month + '&way='+way+ '&day='+day+'&sel_day='+$("sel_day").value+'&sel_month='+$("sel_month").value+'&sel_year='+$("sel_year").value+'&type='+$("type").value);

	return false;
}
function changeMainCountry(module)
{
	if( $("fld_schoolcountryCode")!=null && $("row-school")!=null )
	{
		if( $("fld_schoolcountryCode").value!=''  )
		{
			$("row-school").style.display = "block";
		}
		else
		{
			$("row-school").style.display = "none";
		}
	}

	var country = document.getElementById("fld_countryCode").value;
	var city = "";
	if( $("tmp_cityCode")!=null )
		city = $("tmp_cityCode").value;



	SmartyAjax.update('name_city', SUB_+'index.php', 'get', 'page=comboCity&module='+module+'&f=update_comboCity&country='+country+'&city='+city);
	return false;
}
function changeMainCountryJoin(bool)
{
	if( $("fld_schoolcountryCode")!=null && $("row-school")!=null )
	{
		if( $("fld_schoolcountryCode").value!=''  )
		{
			$("row-school").style.display = "block";
		}
		else
		{
			$("row-school").style.display = "none";
		}
	}

	var country = document.getElementById("fld_countryCode").value;
	var city = "";

	if( $("tmp_cityCode")!=null )
		city = $("tmp_cityCode").value;

	if( $("tmp_cityCode1")!=null )
		city1 = $("tmp_cityCode1").value;

	if( $("tmp_errorCode1")!=null )
	{
		if( $("tmp_errorCode1").value!="" )
		city1 = "";
	}


	SmartyAjax.update('name_city', SUB_+'index.php', 'get', 'page=comboCity&module=profile&f=update_comboCityJoin&country='+country+'&city='+city+'&city1='+city1+'&bool='+bool);
	return false;
}
function changeMainCountryJob(module)
{
	var country = document.getElementById("fld_countryCode").value;
	var allow = document.getElementById("searchLocationType-searchLocation-search").value;
	SmartyAjax.update('name_city', SUB_+'index.php', 'get', 'page=comboCity&module=job&f=update_comboCityJob&country='+country+''+'&allow='+allow+'&part='+module);
	return false;
}
function cngMainCountry()
{
	var country = document.getElementById("fld_countryCode").value;
	var allow = document.getElementById("searchLocationType-searchLocation-search").value;
	SmartyAjax.update('name_city', SUB_+'index.php', 'get', 'page=comboCity&module=job&f=update_comboCityJob&country='+country+''+'&allow='+allow);
	return false;
}
function showLoad(bool)
{

	$('business_details').innerHTML = '<br><img src="./img/pic/pic_uploading_32x32.gif" ><div class="clearfix"></div>';

	if( $('conn_div')!=null )
	{
		if( bool==0 )
			$('conn_div').style.display='none';
		else
			$('conn_div').style.display='block';
	}
}
function changeMainCountryPost()
{
	var country = document.getElementById("fld_countryCode").value;
	if( $("job_id")!=null )
		var job_id = $("job_id").value;
	else
		var job_id = "";
	SmartyAjax.update('name_city', SUB_+'index.php', 'get', 'page=comboCity&module=job&f=update_comboCityPost&country='+country+'&job_id='+job_id);
	return false;
}
function changeMainCountryEvent(eventCity)
{

	SmartyAjax.update('name_city', SUB_+'index.php', 'get', 'page=comboCity&module=job&f=update_comboCityPost&country='+country+'&eventCity='+eventCity);
	return false;
}
function changeCountry1(module)
{
	var country = document.getElementById("fld_schoolcountryCode").value;

	SmartyAjax.update('row-province', SUB_+'index.php', 'get', 'page=addEdu&module='+module+'&f=update_comboState&country='+country+'');
	SmartyAjax.update('row-school', SUB_+'index.php', 'get', 'page=addEdu&module='+module+'&f=update_comboSchool&country='+country+'');
	return false;
}
function changeState()
{

	var country = document.getElementById("fld_schoolcountryCode").value;//fld_schoolprovinceCode
	var state = document.getElementById("fld_schoolprovinceCode").value;//

	SmartyAjax.update('row-school', SUB_+'index.php', 'get', 'page=comboSchool&module=join&f=update_comboSchool1&country='+country+'&states='+state);
	return false;
}
function editEducation(id)
{
	//{ajax_update update_id='main' function='editEducation' params='page=education&module=myprofile'}
	SmartyAjax.update('business_details', SUB_+'index.php', 'get', 'page=education&module=myprofile&f=editEducation&id='+id);
	return false;
}
function editPosition(id)
{
	//{ajax_update update_id='main' function='editEducation' params='page=education&module=myprofile'}
	SmartyAjax.update('business_details', SUB_+'index.php', 'get', 'page=position&module=myprofile&f=editPosition&id='+id);
	return false;
}
function changeOther()
{
	if( document.getElementById("fld_schoolID").value=='other' )
	{
		document.getElementById("fld_schoolText").style['display'] = 'block';
	}
	else
	{
		document.getElementById("fld_schoolText").style['display'] = 'none';
	}
}
/*function logoutWin()
{
	SmartyAjax.update('main', SUB_+'index.php', 'get', 'page=logout&f=showlogout');
	return false;
}*/
function changeRadio(val)
{
	var comp = document.getElementById("companyNameDiv");
	var compTitle = document.getElementById("workCompanyTitleDiv");
	//var edureq = document.getElementById("edureq");
	if( val==1 )
	{
		comp.style['display']='block';
		compTitle.style['display']='block';
		//edureq.innerHTML = "(optional)";
		$('work_here').style.display = "block";
		$('date-past').style.display = "none";
		$('times_period').style.display = "block";
		$('fld_isCurrent').checked = true;
		//$('industry').style.display = "block";
		$('summaryDiv').style.display = "block";

		$('timeperiod_3').style.display="none";
		$('timeperiod').style.display="block";
		$('timeperiod_2').style.display="none";
		$('eduDiv').style.display="none";
		//$('companyCurrentDiv').style.display = "block";
		//$('companyDateDiv').style.display = "block";
	}

	if( val==2 )
	{
		comp.style['display']='block';
		compTitle.style['display']='none';
		//edureq.innerHTML = "(optional)";
		$('work_here').style.display = "none";
		$('date-past').style.display = "none";
		$('times_period').style.display = "block";
		$('fld_isCurrent').checked = false;
		//$('industry').style.display = "block";
		$('summaryDiv').style.display = "block";

		$('timeperiod_3').style.display="block";
		$('timeperiod').style.display="none";
		$('timeperiod_2').style.display="none";
		$('eduDiv').style.display="none";
		//$('companyCurrentDiv').style.display = "none";
		//$('companyDateDiv').style.display = "block";
	}

	if( val>2 && val!=32 )
	{
		comp.style['display']='none';
		compTitle.style['display']='none';
		//edureq.innerHTML = "(optional)";
		$('work_here').style.display = "none";
		$('date-past').style.display = "block";
		$('times_period').style.display = "none";
		$('fld_isCurrent').checked = false;
		//$('industry').style.display = "block";
		$('summaryDiv').style.display = "none";
		$('eduDiv').style.display="none";
		//$('companyCurrentDiv').style.display = "none";
		//$('companyDateDiv').style.display = "block";
	}

	if( val==32 )
	{
		comp.style['display']='none';
		compTitle.style['display']='none';
		//edureq.innerHTML = "(required)";
		$('work_here').style.display = "none";
		$('date-past').style.display = "block";
		$('times_period').style.display = "none";
		$('fld_isCurrent').checked = false;
		//$('industry').style.display = "none";
		$('summaryDiv').style.display = "none";
		$('eduDiv').style.display="block";
		//$('companyCurrentDiv').style.display = "none";
		//$('companyDateDiv').style.display = "block";
	}


}
function showRemovePicture(_this,val,change)
{
	if( _this!=null )
	{
		var _name = _this.name;
		var nm = _name.substring(_name.indexOf("_") + 1);
	}

	if( val==0 && change==1 )
	{
		for( i in arrImg )
		{
			if( document.getElementById( 'chk_' + i )!=undefined )
			{
				arrImg[i].disabled = document.getElementById("chk_"+i).disabled;
				//arrImg[i].checked = document.getElementById("chk_"+i).checked;
				document.getElementById("chk_"+i).disabled = "disabled";
			}
		}
	}
	if( val==1 && change==1 )
	{
		for( i in arrImg )
		{
			if( document.getElementById( 'chk_' + i )!=undefined )
			{
				document.getElementById("chk_"+i).disabled = arrImg[i].disabled;
				//document.getElementById("chk_"+i).checked = arrImg[i].checked;
			}
		}
	}

	if( _this!=null )
	if( val==1 && change==0 )
	{
		if( _this.checked==true )
		{
			$("hdn_"+nm).value = '1';
		}
		else
		{
			$("hdn_"+nm).value = '0';
		}
	}

	if( _this!=null )
	{

		if(_this.checked==true)
			$('pictureSettingsParam3').checked=true;

	}

	//showImage(val);
}
function showImage(val)
{
	if( val==1 )
	{
	document.getElementById("image_none").style['display'] = 'none';
	document.getElementById("image_default_basictop").style['display'] = 'block';
	document.getElementById("image_default_basicbox").style['display'] = 'block';

	for( i in arrImg )
	{
		if( document.getElementById( 'chk_' + i )!=undefined && document.getElementById(i)!=undefined )
		{
			if(i=='image_2' && document.getElementById( 'chk_image_2' ).disabled==false)
			{
				if( document.getElementById( 'chk_image_2' ).checked==true )
					document.getElementById( 'chk_image_512' ).disabled=false;
				else
					document.getElementById( 'chk_image_512' ).disabled=true;
			}

			if(i=='image_4' && document.getElementById( 'chk_image_4' ).disabled==false)
			{
				if( document.getElementById( 'chk_image_4' ).checked==true )
					document.getElementById( 'chk_image_1024' ).disabled=false;
				else
					document.getElementById( 'chk_image_1024' ).disabled=true;
			}

			if(i=='image_8' && document.getElementById( 'chk_image_8' ).disabled==false)
			{
				if( document.getElementById( 'chk_image_8' ).checked==true )
					document.getElementById( 'chk_image_2048' ).disabled=false;
				else
					document.getElementById( 'chk_image_2048' ).disabled=true;
			}

			if( document.getElementById( 'chk_' + i ).checked==true && document.getElementById('chk_' + i).disabled==false )
			{
				document.getElementById(i).style['display'] = 'block';
				document.getElementById( 'hdn_' + i ).value = 1;
			}
			else
			{
				document.getElementById(i).style['display'] = 'none';
				document.getElementById( 'hdn_' + i ).value = 0;
			}
		}
	}
	}
	else
	{
		document.getElementById("image_none").style['display'] = 'block';
		document.getElementById("image_default_basictop").style['display'] = 'none';
		document.getElementById("image_default_basicbox").style['display'] = 'none';

		for( i in arrImg )
		{
			if( document.getElementById( i ) != undefined )
			{
				document.getElementById(i).style['display'] = 'none';
			}
		}
	}
}
function getBrowser () {
  var UA = navigator.userAgent;
  var browserType = 0;

  if (UA.match (/khtml/i) != null)
    browserType = 1;
  else if (UA.match (/gecko/i) != null)
    browserType = 2;
  else if (UA.match (/opera/i) != null)
    browserType = 3;
  else if (UA.match (/msie/i) != null)
    browserType = 4;

  return browserType;
}
function fillCompany()
{
	document.getElementById("fld_companyName").value = document.getElementById("autocomplete").value;//
	document.getElementById("fld_companyTicker").disabled = false;
	document.getElementById("fld_companySize").disabled = false;
	document.getElementById("fld_companyType").disabled = false;
	document.getElementById("fld_companyIndustry").disabled = false;
	document.getElementById("fld_companyName").disabled = false;
	document.getElementById("fld_summaryPosition").disabled = false;
}
function openClose()
{

	if(document.getElementById("customize-block").style['display']=='none')
	{
		document.getElementById("customize-block").style['display'] = 'block';

		document.getElementById("customize-link").className = '';

	}
	else
	{
		document.getElementById("customize-block").style['display'] = 'none';

		document.getElementById("customize-link").className = 'closed';
	}
}