function jsDateDiff( start, end) 
{
    var iOut = 0;

    var bufferA = Date.parse( start ) ;
    var bufferB = Date.parse( end ) ;
    	
    var number = bufferB-bufferA ;
    
    iOut = parseInt(number / 86400000) ;
    return iOut ;
}

function openWin(strURL,strWinName,winWidth,winHeight)
{
	var chngpass;
	winTop=0
	winLeft=0
	winLeft=Math.floor((Math.abs(screen.availWidth-winWidth))/2);
	winTop=Math.floor((Math.abs(screen.availHeight-winHeight))/2);

	strWin=window.open(strURL,strWinName,'top='+ winTop + ',left=' + winLeft + ',width=' + winWidth + ',height=' + winHeight + ',toolbar=no menubar=no,location=no,directories=no,status=no,resizable=no,scrollbars=yes');
	return strWin;
}


function getPage(f1, a, b) {
	 p = "Personnal Information:<br>";
	 p += " Name : " + f1.EnquiryName.value + "<br>";
	 p += " Telephone No. : " + f1.EnquiryTel.value + "<br>";
	 p += " Mobile No. : " + f1.Enquirymob.value + "<br>";
	 p += " e-Mail ID : " + f1.EnquiryEmail.value + "<br>";
	 p += " Address : " + f1.EnquiryAddress.value + "<br><br>";
	 p += "HSMP Score:<br>";
	 //p += " 1. MBA Provision         : " + document.getElementById('mba_check').value + " / 75 points<br>";
	 p += " 1. Qualification         : " + document.getElementById('qualification').value + " / 50 points<br>";
	  p += " 2. Earnings              : " + document.getElementById('earn_point').value + " / 45 points<br>";
	  p += " 3. Work Experience       : " + document.getElementById('work_experience').value + " / 50 points<br>";
	 p += " 4. Age                   : " + a + " / 20 points<br>";
	 p += " 5. English Language Requirement           : " + b + " / 10 points<br>";
	 
	 
	 //p += " 5. Achievement           : " + document.getElementById('achievement').value + " / 50 points<br>";
	
	 //p += " 7. Priority Applications : " + document.getElementById('priority').value + " / 50 points<br>";
	 //p += " 8. Partner's Adventure   : " + document.getElementById('spa').value + " / 10 points<br><br>";
	 return p;
 }

function trim(strText)
{
	if (strText.length > 0)
	{
		while (strText.indexOf(" ")==0)
		{
			strText = strText.replace(" ","")
		}

		while (strText.lastIndexOf(" ")==strText.length-1 && strText.length > 0)
		{
			strText = strText.substring(0,(strText.length-1))
		}
	}
	return strText;
}

function chkUserName(txtElement,fieldName)
{
	if(trim(txtElement.value).length == 0)
	{
		alert("Please enter '" + fieldName + "'");
		txtElement.focus();
		return false;
	}
	
	return true;
}

 /*function getEarnings(earn, country, old) {
	 	points = 0;
	 	switch (country) {
			case 'A':
				switch(old) {
					case 0:
						if (earn >= 10 && earn < 14) points = 25;
						if (earn == 14 || earn == 15) points = 35;
						if (earn >= 16) points = 50;
						break;
					case 5:
						if (earn == 8 || earn == 9) points = 25;
						if (earn == 10 || earn == 11) points = 35;
						if (earn >= 12) points = 50;
						break;
					case 102:
						if (earn == 8 || earn == 9) points = 25;
						if (earn == 10 || earn == 11) points = 35;
						if (earn >= 12) points = 50;
						break;
					case 20:
						if (earn == 8 || earn == 9) points = 25;
						if (earn == 10 || earn == 11) points = 35;
						if (earn >= 12) points = 50;
						break;
				}
				break;
				
			case 'B':
				switch(old) {
					case 0:
						if (earn >= 6 && earn < 10) points = 25;
						if (earn >= 10 && earn < 15) points = 35;
						if (earn >= 15) points = 50;
						break;
					case 5:
						if (earn >= 4 && earn < 6) points = 25;
						if (earn == 6 || earn == 7) points = 35;
						if (earn >= 8) points = 50;
						break;
					case 10:
						if (earn == 8 || earn == 9) points = 25;
						if (earn == 10 || earn == 11) points = 35;
						if (earn >= 12) points = 50;
						break;
					case 20:
						if (earn == 8 || earn == 9) points = 25;
						if (earn == 10 || earn == 11) points = 35;
						if (earn >= 12) points = 50;
						break;
				}			
				break;
				
			case 'C':
				switch(old) {
					case 0:
						if (earn >= 5 && earn < 9) points = 25;
						if (earn >= 9 && earn < 13) points = 35;
						if (earn >= 13) points = 50;
						break;
					case 5:
						if (earn == 4) points = 25;
						if (earn == 5 || earn == 6) points = 35;
						if (earn >= 7) points = 50;
						break;
					case 10:
						if (earn == 8 || earn == 9) points = 25;
						if (earn == 10 || earn == 11) points = 35;
						if (earn >= 12) points = 50;
						break;
					case 20:
						if (earn == 8 || earn == 9) points = 25;
						if (earn == 10 || earn == 11) points = 35;
						if (earn >= 12) points = 50;
						break;
				}
				break;
				
			case 'D':
				switch(old) {
					case 0:
						if (earn >= 3 && earn < 6) points = 25;
						if (earn >= 6 && earn < 12) points = 35;
						if (earn >= 12) points = 50;
						break;
					case 5:
						if (earn == 2) points = 25;
						if (earn == 3) points = 35;
						if (earn >= 4) points = 50;
						break;
					case 10:
						if (earn == 8 || earn == 9) points = 25;
						if (earn == 10 || earn == 11) points = 35;
						if (earn >= 12) points = 50;
						break;
					case 20:
						if (earn == 8 || earn == 9) points = 25;
						if (earn == 10 || earn == 11) points = 35;
						if (earn >= 12) points = 50;
						break;
				}
				break;
				
			case 'E':
				switch(old) {
					case 0:
						if (earn == 2 || earn == 3) points = 25;
						if (earn >= 4 && earn < 8) points = 35;
						if (earn >= 8) points = 50;
						break;
					case 5:
						if (earn == 1) points = 25;
						if (earn == 2) points = 35;
						if (earn > 2) points = 50;
						break;
					case 10:
						if (earn == 8 || earn == 9) points = 25;
						if (earn == 10 || earn == 11) points = 35;
						if (earn >= 12) points = 50;
						break;
					case 20:
						if (earn == 8 || earn == 9) points = 25;
						if (earn == 10 || earn == 11) points = 35;
						if (earn >= 12) points = 50;
						break;
				}
				break;
		}
	return points;
 }*/ 