

//function for open cv review page
function openNewCVReviewPage(page, sid, cvid)
{
	var openString = page + "?" + sid + "&cvid=" + cvid;
	var win = window.open(openString);
	win.focus(); 	
}


function openCVEditPanel(panelURL, sid, cvid)
{
		var openURL = panelURL + "?" + sid + "&cvid=" + cvid;
		//alert(openURL);
		var win = window.open(openURL, "", "toolbar=0, menubar=0, resizable=1, location=0");
		win.moveTo(-4, -4);
		win.resizeTo(screen.availWidth+8, screen.availHeight);
		win.focus();			
}
	
//function for open cv view page
function openWorkerCVView(pageURL, sid, cvid)
{
	var openURL = pageURL + "?" + sid + "&cvid=" + cvid + "&view=1";
	var wind = open(openURL, "", "width=800, height=500, resizable=yes,scrollbars=yes, toolbar=0, menubar=1, location=0");
	wind.focus();	
}


//function for open empl cv view page
function openEmplCVView(pageURL, sid, cvid)
{
	var openURL = pageURL + "?" + sid + "&recid=" + cvid + "&view=1";
	var wind =window.open(openURL, "", " width=800, height=500, toolbar=0, menubar=1, resizable=1, location=0, scrollbars=1");
	wind.focus();
}

//function for open letter view page
function openWorkerLetterView(pageURL, sid, letid)
{
	var openURL = pageURL + "?" + "letid=" + letid + "&" + sid;
	var wind = open(openURL, "", "width=778, height=500, resizable=yes,scrollbars=yes, toolbar=0, menubar=1, location=0");
	wind.focus();	
}

//functions for open adds
function openJobAdds(URL) 
{ 
  	var adds = open(URL,"","width=780, height=500, resizable=yes,scrollbars=yes, toolbar=0, menubar=1, location=0");
   	adds.focus();
}  

//functions for open adds
function openPackCV(URL) 
{ 
  	var cv = open(URL,"","width=800, height=500, resizable=yes,scrollbars=yes, toolbar=0, menubar=1, location=0");
   	cv.focus();
}  

function openCondition(pageURL, sid)
{
		var openURL = pageURL + "?" + sid;
		//alert(openURL);
		var win = window.open(openURL, "", "toolbar=0, menubar=0, resizable=1, location=0, scrollbars=1");
		win.moveTo(-4, -4);
		win.resizeTo(screen.availWidth+8, screen.availHeight);
		win.focus();			
}



/*

//function for changes link an active link
function setActiveLink (operLink, linkStatus)
{
	if(linkStatus)
		operLink.style.textDecoration = "underline";
	else
		operLink.style.textDecoration = "none";
}


*/


function setActivePlanLink (operLink, linkStatus)
{
	if(linkStatus)
		operLink.style.color = "#B1B5C7";
	else
		operLink.style.color = "black";
}



function setActiveLink (operLink, linkStatus)
{
	if(linkStatus)
		operLink.style.color = "#B1B5C7";
	else
		operLink.style.color = "#FE7A22";
}



//function for set active link diferent color
function setActiveLinkColor(operLink, linkStatus, linkColor)
{
	//color for edot link '#6EC869'
	if(linkStatus)
		operLink.style.color = linkColor;
	else
		operLink.style.color = linkColor;
}


//function for changes link an active link
function setActiveCategoryLink (operLink, linkStatus)
{
	if(linkStatus)
		operLink.style.color = "#FE7A22";
	else
		operLink.style.color = "#636363";
}


//function for set active main link
function setActiveMainLink (operLink, linkStatus)
{
		
	//if mouse over menu link akcent this link
	if(linkStatus)
	{
		operLink.style.borderTop = "1px #FE7A22 dashed";
		operLink.style.borderBottom = "1px #FE7A22 dashed";
		operLink.style.borderLeft = "4px #75E76C solid"; 
		operLink.style.borderRight = "4px #75E76C solid"; 
	}
	else	//else mouse out ftom menu link set default link
	{
		operLink.style.borderTop = "1px #C4D6E6 dashed";
		operLink.style.borderBottom = "1px #C4D6E6 dashed";
		operLink.style.borderLeft = "none";
		operLink.style.borderRight = "none"; 
	}

}	

//function for set home page links
function setCustomLinkActive(operLink, linkColor, linkUnder)
{
	//check aktivate link or pasivate
	operLink.style.color = linkColor;
	
	//set under line
	operLink.style.textDecoration = linkUnder? 'underline' : 'none';
} 
		



function preLoadCntChar(text, limit, cntChars, errorColor)
{
	
	var textEl =  document.getElementById(text);
	if(textEl.value.length >= limit) 
	{
		document.getElementById(cntChars).style.color = errorColor;
	} 
	document.getElementById(cntChars).childNodes[0].data = textEl.value.length;
}

function cntchar(text, limit, cntChars, errorColor, rightColor) 
{
	
	var counter = document.getElementById(cntChars);
	if(text.value.length >= limit) 
	{
		text.value = text.value.substr(0, limit);
		counter.style.color = errorColor;
		
	}
	else
	{
		counter.style.color = rightColor;
	}
	
	document.getElementById(cntChars).childNodes[0].data = text.value.length;
	
}
