var xmlHttp

function showPrice(str,num)
{
	
	submitNum = num
	blnIncCV = document.getElementById("cv"+submitNum)
	//check if allow CV access tickbox is ticked
	if (blnIncCV.checked==1)
	{	
		blnIncCV = true
	}
	else
	{
		blnIncCV = false
	}	
	
	if (str=="ticked"&&!(submitNum==1))
	{	
		str = document.getElementById("package"+submitNum).value
	}
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 

	switch(submitNum)
		{
			//Select which submit button was pressed
			case 1:
				if (blnIncCV)
					{
						str = 13
					}
				else
					{
						str = 11
					}
				break
				
			// Bronze package
			case 2:
				//Check if CV access tickbox was on, then see what package they chose
				if (blnIncCV)
					{
						//3 months
						if (str == "3")
							{				
							str = 22
							}
						//6 months
						else if (str == "6")
							{
							str = 23
							}	
						//12 months
						else if (str == "12")
							{
							str = 24
							}		
					}
				else
					{
						//3 months
						if (str == "3")
							{
							str = 17
							}		
						//6 months
						else if (str == "6")
							{
							str = 18
							}	
						//12 months
						else if (str == "12")
							{
							str = 19
							}
							
					}
				break
				
			// Silver
			case 3:
				//Check if CV access tickbox was on, then see what package they chose
				if (blnIncCV)
					{
						//3 months
						if (str == "3")
							{
							str = 30
							}
						//6 months
						else if (str == "6")
							{
							str = 31
							}
						//12 months
						else
							{
							str = 32
							}
					}
				else
				{
					//3 months
					if (str == "3")
						{
						str = 26
						}
					//6 months
					else if (str == "6")
						{
						str = 27
						}
					//12 months
					else
						{
						str = 28
						}
				}
				break
				
			// Gold
			case 4:
				//Check if CV access tickbox was on, then see what package they chose
				if (blnIncCV)
					{
						//3 months
						if (str == "3")
							{
							str = 38
							}
						//6 months
						else if (str == "6")
							{
							str = 39
							}
						//12 months
						else
							{
							str = 40
							}
					}
				else
					{
						//3 months
						if (str == "3")
							{
							str = 34
							}
						//6 months
						else if (str == "6")
							{
							str = 35
							}
						//12 months
						else
							{
							str = 36
							}
					}
				break
				
			// Sales Evaluation Test
			case 5:
				//3 months
				if (str == "3")
					{
					str = 42
					}
				//6 months
				else if (str == "6")
					{
					str = 43
					}
				//12 months
				else
					{
					str = 44
					}	
				break
			
			// Job of the Week
			case 6:
				str = 46
				break
				
			// Bronze package - 25 Job Slots
			case 7:
				//Check if CV access tickbox was on, then see what package they chose
				if (blnIncCV)
					{
						//3 months
						if (str == "3")
							{				
							str = 54
							}
						//6 months
						else if (str == "6")
							{
							str = 55
							}	
						//12 months
						else if (str == "12")
							{
							str = 56
							}		
					}
				else
					{
						//3 months
						if (str == "3")
							{
							str = 51
							}		
						//6 months
						else if (str == "6")
							{
							str = 52
							}	
						//12 months
						else if (str == "12")
							{
							str = 53
							}
					}	
				break		
		}
		
	str = String(str)
	var url="includes/getPricing.asp"
	url=url+"?pid="+str
	url=url+"&sid="+Math.random()
	url=url+"&submitNum="+submitNum
	url=url+"&blnIncCV="+blnIncCV
	
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}


function stateChanged() 
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("txtPricing"+submitNum).innerHTML=xmlHttp.responseText 
} 
} 

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
