function launch( url, name, w, h ) {
	yOffset = 20;
	xOffset = winW - ( winW / 3);
    pop = window.open( url,name,"width="+w+",height="+h+",status=1,resizable=0,menubar=0,toolbar=0,directories=0,location=0,scrollbars=1,top="+yOffset+",left="+xOffset );
	pop.focus();
}

function sc( obj, colour ) {
	if (document.getElementById(obj)){	//Internet Explorer 5+ or Netscape 6	
		document.getElementById(obj).style.backgroundColor = colour;
	} else{ //Earlier IE or Netscape
		if (document.all){ //Earlier IE 
			document.all[obj].style.backgroundColor = colour;
		} else {
			if (document.layers && document.layers[obj])
			document.layers[obj].backgroundColor = colour; //Netscape 4
		}
	}
}

var backgroundColour = '';
function switchColourOn( obj, colour ) {
	sc( 'bg', '#' + colour );
	sc( 'white_'+obj, '#FFFFFF' );
	sc( 'colour_'+obj, '#' + colour );
}

function switchColourOff( obj, colour ) {
	sc( 'bg', '#' + colour );
	sc( 'white_'+obj, '' );
	sc( 'colour_'+obj, '' );
}

function borderOn( obj ) {
	sc( 'white_'+obj, '#FFFFFF' );
}

function borderOff( obj ) {
	sc( 'white_'+obj, '' );
}

function cBG( colour ){
	sc( 'bg', '#' + colour );
}

function switchContentTextColour( colour ){
	sc( 'sfc_text', colour );
}

function switchContentImageColour( colour ){
	sc( 'sfc_img', colour );
}

function setSize(){
	var scr_w = screen.availWidth;
	var scr_h = screen.availHeight;
	var IE = document.all?true:false
	browseWidth = (!IE)? window.outerWidth : document.body.clientWidth;
	browseHeight = (!IE)? window.outerHeighth : document.body.clientHeight;
	if(browseWidth<900){
		if (scr_w != browseWidth|| scr_h != browseHeight) {
		   window.resizeTo(scr_w, scr_h);
		   window.moveTo(0, 0);
		}
	}
}

function CheckRequired(which){
	var pass=true
	if (document.images){
		for (i=0;i<which.length;i++){
			var tempobj=which.elements[i]
			if (tempobj.name.substring(0,8)=="required"){				
				if (((tempobj.type=="text"||tempobj.type=="textarea"||tempobj.type=="file")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1)){
					pass=false
					break
				}
				/*if((tempobj.type=="file")&&(tempobj.name.indexOf("small")>0)){
					ValidateImage(tempobj.value);
				}*/
			}
		}
	}
	if (!pass){
		alert("One or more of the required form fields are not completed. Please complete them, then submit again!")
		return false
	}
	else{
		for (i=0;i<which.length;i++){
			var tempobj=which.elements[i]
			if (tempobj.name.substring(0,8)=="required"){
				tempobj.name = tempobj.name.substring(8,tempobj.name.length);
				//alert(tempobj.name);
			}
		}
		return true
	}		
}