//

/**
 * Get country
 * @param code
 * @param lang
 * @return
 */
function getCountryAjax(code,lang)
{
	$.ajax({
	 	type: "post",
	 	url: "../inc/ajaxSubmit.php",
		data: "op=getCountry&code="+code+"&lang="+lang,
		success: function(msg)
		{
			$('#showCountry')[0].innerHTML = msg;
		}		
	 });
}

function getJobsAjax(code, lang)
{
	$.ajax({
	 	type: "post",
	 	url: "../inc/ajaxSubmit.php",
		data: "op=getJobs&code="+code+"&lang="+lang,
		success: function(msg)
		{
			$('#showJobs')[0].innerHTML = msg;
		}		
	 });
}

/**
 * Get company
 * @param code
 * @param lang
 * @return
 */
function getCompanyInfo(code,lang)
{
	$.ajax({
	 	type: "post",
		url: "./inc/ajaxSubmit.php",
		data: "op=getCompanyInfo&id="+code+"&lang="+lang,
		success: function(msg)
		{
			$('#nodeList')[0].innerHTML = msg;
		}
		/*beforeSend: function()
		{
			
		}*/		
	 });
}

/**
 * Create HTML Element
 * @param str
 * @return
 */
function createShowInfo(str)
{
	var showInfoDiv = document.createElement(str);
	showInfoDiv.id = 'nodeList';
	//showInfoDiv.style.width = '200px';
	showInfoDiv.style.position = 'absolute';
	showInfoDiv.style.backgroundColor = '#F0F0F0';
	showInfoDiv.style.border = 'solid 1px #CCCCCC';
	showInfoDiv.style.padding = '0 3px';
	showInfoDiv.style.display = 'none';
	$('body').append(showInfoDiv);
}

/**
 * Check int
 * @param str String.
 * @return bool
 */
function checkInteger(str)
{
	var pattern = /^([0-9.]+)$/;
	if (pattern.test(str))
	{
		return true;
	}
	else
	{
		return false;
	}
}

/**
 * Check email
 * @param value
 * @return
 */
function checkEmail(value)
{
	var myreg = /^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$/;
	if(!myreg.test(value))
	{
		return false;
	}
	else
	{
		return true;
	}
}

/**
 * IE6 JS under a transparent PNG background
 *
 */
function alphaBackgrounds(){
   var rslt = navigator.appVersion.match(/MSIE (d+.d+)/, '');
   var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
   for (i=0; i<document.all.length; i++){
      var bg = document.all[i].currentStyle.backgroundImage;
      if (bg){
         if (bg.match(/.png/i) != null){
            var mypng = bg.substring(5,bg.length-2);
   //alert(mypng);
            document.all[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='crop')";
            document.all[i].style.backgroundImage = "url('')";
   //alert(document.all[i].style.filter);
         }                                              
      }
   }
}