// JavaScript Document
var OP5, NN4;
var dt = document;
OP5 = false;
NN4 = false;
if(navigator.appName == "Netscape"){
	NN4 = true;
}
if(navigator.appName == "Opera"){
	OP5 = true;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function changetextandimage2(coursecode, title, durationfrom, durationto, datestart, coursefee, classvacancy, coursedetails) {
	document.getElementById("coursetitletb").innerText = title;
	//document.getElementById("CalendarFrom").SelectedDate= durationfrom;
	//document.getElementById("CalendarTo").SelectedDate= durationto;
	//document.getElementById("CalendarStartDate").SelectedDate = datestart;
	document.getElementById("feetb").innerText= coursefee;
	document.getElementById("vacancytb").innerText = classvacancy; 
	document.getElementById("courseDetailstb").innerText=coursedetails;
	document.getElementById("coursecodetb").innerText=coursecode;
	document.getElementById("CalendarDurFrom").innerText=durationfrom;
	document.getElementById("CalendarDurTo").innerText=durationto;
	document.getElementById("CalendarStartDate").innerText=datestart;
	adminUpdateCourse(""+coursecode);
}
function adminUpdateCourse(idd){
	//url = "adminupdate.aspx?salary=" + salary + "&id=" + id + "&coy=" + coy + "&title=" + title + "&scope=" + scope + "&type=" + type + "&req=" + req + "&add=" + add + "&country=" + country;
	url = "updatejobcode.aspx?id=" + idd ;
	setTimeout("getJobCode('"+url+"')", 500);
	clearTimeout();
}

function getJobCode(wordId)
{
	//make a connection to the server ... specifying that you intend to make a GET request 
    //to the server. Specifiy the page name and the URL parameters to send
    http.open('get', wordId);
	
    //assign a handler for the response
    http.onreadystatechange = processMainJobCode;
	
    //actually send the request to the server
    http.send(null);	
}

// Ajax Intialization Here
function createRequestObject() {
    var tmpXmlHttpObject;
    
    //depending on what the browser supports, use the right way to create the XMLHttpRequest object
    if (window.XMLHttpRequest) { 
        // Mozilla, Safari would use this method ...
        tmpXmlHttpObject = new XMLHttpRequest();
	
    } else if (window.ActiveXObject) { 
        // IE would use this method ...
        tmpXmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    return tmpXmlHttpObject;
}

//call the above function to create the XMLHttpRequest object
var http = createRequestObject();

function processMainJobCode() {
    //check if the response has been received from the server
    if(http.readyState == 4){
	
        //read and assign the response from the server
        var response = http.responseText;
		
        //do additional parsing of the response, if needed
		
        //in this case simply assign the response to the contents of the <div> on the page. 
        //document.getElementById('cartlist').innerHTML = response;
		//document.getElementById('tb_totalPrice').value = document.getElementById('tb_totalPricehidden').value
        //If the server returned an error message like a 404 error, that message would be shown within the div tag!!. 
        //So it may be worth doing some basic error before setting the contents of the <div>
    }
}


