function validateSiteSearch(theform){
	var totalstrerrors="";
	if(theform.q.value=="" || theform.q.value=="search site" || theform.q.value==null){
		totalstrerrors += "Please Enter a Search Term\n";
	}
	if (totalstrerrors == ""){
		//theform.action="/Store/SearchResults";
    	theform.submitForm.disabled = true;
		//theform.submit;
    	return true;
  	}else{
    	alert(totalstrerrors);
    	theform.submitForm.disabled = false;
    	return false;
  	}
}
function popitup(url, width, height) {
	h = screen.height;
	if (h<900) {
		newwindow=window.open(url,'name','scrollbars=1,resizable=1,height=' +  h + ',width=' + width);
	} else {
		newwindow=window.open(url,'name','scrollbars=1,resizable=1,height=' +  height + ',width=' + width);
	}
	if (window.focus) {newwindow.focus()}
	return false;
}
function maximize(maxDiv){
	if(document.getElementById && document.createTextNode){
	  if(document.getElementById(maxDiv)){
		document.getElementById(maxDiv).className='maximized';
	  }
	}
}
function minimize(minDiv){
	if(document.getElementById && document.createTextNode){
	  if(document.getElementById(minDiv)){
		document.getElementById(minDiv).className='minimized';
	  }
	}
}
function changeHTML(HTMLelementID, newHTML){
	if(document.getElementById(HTMLelementID)){
			document.getElementById(HTMLelementID).innerHTML=newHTML;
	}
}

function getQueryParameters() {
  var query = window.location.href.split('?')[1];
 
  //query won't be set if ? isn't in the URL
  if(!query) {
    return { };
  }
 
  var params = query.split('&');
 
  var pairs = {};
  for(var i = 0, len = params.length; i < len; i++) {
    var pair = params[i].split('=');
    pairs[pair[0]] = pair[1];
  }
  alert(pairs);
  return pairs;
  
}

function newVideo(name){
	var v1 = new SWFObject("/flash/videoplayer.swf", "videoplayer", "400", "325", "9", "transparent");
	v1.addParam('allowScriptAccess', 'always');
	v1.addParam('wmode', 'transparent');
	v1.addVariable('fileURL', '/video/'+name+'.flv');
	v1.addVariable('imgURL', '/images/videos/'+name+'_large.jpg');
	v1.addVariable('a', 1);
	v1.useExpressInstall('expressinstall.swf');
	v1.write("videoDiv");
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
