function confirmDeleteItem()
{
var agree2=confirm("Are you sure you want to delete the item?");
if (agree2)
        return true ;
else
        return false ;
}

	function openWin( winHeight, winWidth, picSrc ){
		newWin = window.open('', '', 'height='+ winHeight + ',width='+ winWidth + 'toolbars=no, scrollbars=no' );
		newWin.document.write("<head><title>"+ picSrc +"</title></head>");
		newWin.document.write("<center>");
		newWin.document.write("<img src=" + picSrc + ">");
		newWin.document.write("<br><br><form><input type='button' value='Close' onclick='JavaScript:window.close()'>");
		newWin.document.write("</form></center>");
	}

			function loadurl(dest, msgDivv) {
			 try {
			   xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():
			  		new ActiveXObject("Microsoft.XMLHTTP");
			 }
			 catch (e) { /* do nothing */ }
			 msgDiv=msgDivv;
			 xmlhttp.onreadystatechange = triggered;
			 xmlhttp.open("GET", dest);
			 xmlhttp.send(null);
			}
			
			function triggered() {
			  if (xmlhttp.readyState == 4) if (xmlhttp.status == 200)
			    document.getElementById(msgDiv).innerHTML =xmlhttp.responseText;
			}



// ================================================================================
    // NOTES ABOUT SCRIPT
    // ================================================================================
    // JavaScript Slick Form Validation
    // by Tim Bobo
    // Adapted loosely from a script by Paul Colton
    // if you use any of these functions please send me some e-mail (timbobo@leftbrainmedia.com) 
    // to let me know; I always like to know when someone likes my work.
    // Also give me a little credit in your code, like I have done for Paul Colton (above)     
    // and Danny Goodman (below).  If you make some improvements to my script, send them
    // my way.
    

    // ================================================================================
    // FUNCTION submit_pages() 
    // ================================================================================
    
    function submit_page(form) {

	    foundError = false; // used at end of script to decide if to submit or not
		document.getElementById("regionErr").innerHTML='';
		document.getElementById("main_catErr").innerHTML='';
		document.getElementById("categoryErr").innerHTML='';
		document.getElementById("titleErr").innerHTML='';
		document.getElementById("descriptionErr").innerHTML='';
		document.getElementById("priceErr").innerHTML='';
		document.getElementById("contactErr").innerHTML='';
        // ............................................................................
        // CHECK THAT FIELDS AREN'T EMPTY
        // ............................................................................       
        
        regionError = "";  // if the script find an error is places the message in this varible
        if(form.region.value == "") {
            regionError = "Please choose a region. \r";
            foundError = true;
        }
		
        main_catError = "";  // if the script find an error is places the message in this varible
        if(form.main_cat.value == "") {
            main_catError = "Please choose a main category. \r";
            foundError = true;
        }
        
        categoryError = "";  // if the script find an error is places the message in this varible
        try{
	        if(form.category.value == "") {
            categoryError = "You left the category field blank. \r";
            foundError = true;
        	}
    	} catch (e) {}
        
        titleError = "";  // if the script find an error is places the message in this varible
        if(form.title.value == "") {
            titleError = "You left the title field blank. \r";
            foundError = true;
        }
        
        descriptionError = "";  // if the script find an error is places the message in this varible
        if(form.description.value == "") {
            descriptionError = "You left the description field blank. \r";
            foundError = true;
        }
        
        priceError = "";  // if the script find an error is places the message in this varible
        if(form.price.value == "") {
            priceError = "You left the price field blank. \r";
            foundError = true;
        }
        
        contactError = "";  // if the script find an error is places the message in this varible
        if((form.tel1.value == "")&&(form.tel2.value == "")&&(isValidEmail(form.email) == false)) {
            contactError = "Please enter at least one contact detail. \r";
            foundError = true;
        }
        
        

        
        // ............................................................................
        // INFORMATIN USER ABOUT PROBLEMS OR DISPLAY THANK YOU MESSAGE
        // ............................................................................

        if(foundError == false) {
             return true;
        }
        else { // SELECT THE FIRST PROBLEM FIELD
            alert ('There were errors')
            if (regionError != "") {document.getElementById("regionErr").innerHTML = regionError;}
            if (main_catError != "") {document.getElementById("main_catErr").innerHTML = main_catError;}
            if (categoryError != "") {document.getElementById("categoryErr").innerHTML = categoryError;}
            if (titleError != "") {document.getElementById("titleErr").innerHTML = titleError;}
            if (descriptionError != "") {document.getElementById("descriptionErr").innerHTML = descriptionError;}
            if (priceError != "") {document.getElementById("priceErr").innerHTML = priceError;}
            if (contactError != "") {document.getElementById("contactErr").innerHTML = contactError;}
            return false;                       
        }   
    }

    // ================================================================================
    // FUNCTION isValidEmail(theField)
    // ================================================================================
    
    // Check for a valid email address
    // This is not full proof.  It simply looks for text before and after an @ symbol.
    // it calles on getFront & getEnd which are listed below this function
    
    function isValidEmail(theField) {
        if((getFront(theField.value,"@") != null) && (getEnd(theField.value,"@") != "")) {
            // alert (getFront(theField.value,"@"))
            // alert (getEnd(theField.value,"@"))
            return true; // the e-mail address is considered valid
        } else {
            return false; // the e-mail address is considered invalid
        }
    }
    
    // ================================================================================
    // FUNCTIONS getFront & getEnd
    // ================================================================================

    // The following 2 functions are adapted from Danny Goodman's JavaScript Handbook
    // and boy are they handy for a not much of a scripting language called JavaScript
    
    // ................................................................................
    // EXTRACT FRONT PART OF STRING PRIOR TO SEARCHSTRING
    // ................................................................................
    
    function getFront(mainStr,searchStr){
        foundOffset = mainStr.indexOf(searchStr)
        if (foundOffset <= 0) {
            return null // if the @ symbol is missing the value is -1
                        // if the @ symbol is the first char the value is 0
        } 
        else {
            return mainStr.substring(0,foundOffset)
        }
    }
    
    // ................................................................................
    // EXTRACT BACK END OF STRING AFTER TO SEARCHSTRING
    // ................................................................................
    
    function getEnd(mainStr,searchStr) {
        foundOffset = mainStr.indexOf(searchStr)
        if (foundOffset <= 0) {
            return ""   // if the @ symbol is missing the value is -1
                        // if the @ symbol is the first char the value is 0
                        // I switched this to return "" so it would match the result of an empty
                        // string below
        }
        else {
            return mainStr.substring(foundOffset+searchStr.length,mainStr.length)
                        // if nothing exists after the @ symbol this will return an empty string
        }
    }

    // ================================================================================
    // END OF MAIN SCRIPT
    // ================================================================================
// -->


//28 and 33 are the IDs of the jobs and notices categories
function adType(option) {
	if (option=='33')
	{
		document.getElementById('priceTr').innerHTML ='&nbsp;<em>Not Applicable</em>';
	}
	else if (option=='28')
	{
		document.getElementById('priceTr').innerHTML ='&nbsp;<em>Not Applicable</em>';
	}
	else
	{
		document.getElementById('priceTr').innerHTML ='<input type="text" name="price" value="" />';
	}
}