function expCol(me, section){
	showExp = document.getElementById(section);
	
	if(showExp.style.display == "block"){
		showExp.style.display = "none";
		me.innerHTML = "view";
	}else{
		showExp.style.display = "block";
		me.innerHTML = "hide";
	}
}

 

// DATA GATHERING
function createRequestObject() {
	var req;
	if(window.XMLHttpRequest){
	  // Firefox, Safari, Opera...
	  req = new XMLHttpRequest();
	} else if(window.ActiveXObject) {
	  // Internet Explorer 5+
	  req = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	  // There is an error creating the object,
	  // just as an old browser is being used.
	  alert('Problem creating the XMLHttpRequest object');
	}
	return req;
}
	

var http = createRequestObject(); // Make the XMLHttpRequest object
var varDiv; // location of response data to be written

/* [BEGIN]: Comments requests */
function sendComments(page) {// send request the request
	
	var name = document.comments.name.value;
	var comment = document.comments.comment.value;
	var er='';
	if(!name){
		er += "Please fill in your name. \n"
	}
	if(!comment){
		er += "Please fill in your comment. \n"
	}
	
	if(er){
		alert(er);
	}else{
		http.open('get', '/ad/processes/comments.php?&n='+name+'&c='+escape(comment)+'&p='+page+'&v=go');	 
			
		// Send off the response
		http.onreadystatechange = handleResponse;
		http.send(null);
	}
}

function handleResponse() {
   if(http.readyState == 4 && http.status == 200){
      // Text returned FROM the PHP script
      var response = http.responseText;
      if(response) {
		document.getElementById('userComments').innerHTML = response;
		document.comments.name.value = ''; // clear values
		document.comments.comment.value='';// clear values
			
      }

   }

}
/* [END]: Comments requests */


/* BEGIN: [Global Open Window Script]
	** Example on calling this function:
	** openNewWin(this, {url:"http://foxsports.com", scrollbars: "yes", name: "my_window"});
	** Using options, call what you want to change only.  Inside the function, defaults are set and explained.
*/
function openNewWin(me, options){
	var options = options || {}; // options setup.
	var wUrl = options.url || null; // url for pop-up.  Default is null.
	var wName = options.name || "FS_Window"; // name for pop-up.  Default is "FS_Window".
	var wWidth = options.width || 800; // width of pop-up. Default is 800px;
	var wHeight = options.height || 600; // height of popup.  Default is 600px.
	var wTop = options.top || 25; // top position from the browser.  Default is 25px.
	var wLeft = options.left || 25; // left position form the browser. Default is 25px.
	var wToolbar = options.toolbar || "no"; // Whether or not to display the browser toolbar. Default is "no".
	var wLocation = options.location || "no"; // Whether or not to display the address field. Default is "no".
	var wDirectories = options.directories || "no"; // Whether or not to add directory buttons. Default is "no"
	var wStatus = options.status || "no"; // Whether or not to add a status bar. Default is "no".
	var wMenubar = options.menubar || "no"; // Whether or not to display the menu bar. Default is "no".
	var wResizable = options.resizable || "yes"; // Whether or not the window is resizable. Default is "yes".
	var wScrollbars = options.scrollbars || "no"; // Whether or not to display scroll bars. Default is "no".
	var wFullscreen = options.fullscreen || "no"; // Whether or not to display the browser in full-screen mode. Default is "no". A window in full-screen mode must also be in theater mode.
	var wChannelmode = options.channelmode || "no"; // Whether or not to display the window in theater mode. Default is "no".

	window.open(wUrl,wName,"width="+wWidth+",height="+wHeight+",top="+wTop+",left="+wLeft+",toolbar="+wToolbar+",location="+wLocation+",directories"+wDirectories+",status="+wStatus+",menubar="+wMenubar+",resizable="+wResizable+",scrollbars="+wScrollbars+",fullscreen="+wFullscreen+",channelmode="+wChannelmode);
}
/* END: [Global Open Window Script] */

