LightboxOptions = Object.extend({
    fileLoadingImage:        _host + 'img/loading.gif',     
    fileBottomNavCloseImage: _host + 'img/closelabel.gif',
    overlayOpacity: 0.8,   // controls transparency of shadow overlay
    animate: true,         // toggles resizing animations
    resizeSpeed: 7,        // controls the speed of the image resizing animations (1=slowest and 10=fastest)
    borderSize: 10,         //if you adjust the padding in the CSS, you will need to update this variable
		labelImage: "Image",
		labelOf: "of"
}, window.LightboxOptions || {});

document.observe("dom:loaded", function(){
	$$("#submit_article_review_form input, #submit_article_review_form textarea").each( function(input) {
		new Tooltip(input, {backgroundColor: "#FC9", borderColor: "#C96", 
		textColor: "#000", textShadowColor: "#FFF"});
	});
	
	var so1 = new SWFObject("http://www.topseos.com/mini_player/flvplayer.swf", "flvplayer", "247", "206", "8",  null, true);
	so1.addParam("allowFullScreen", "true");
	so1.addVariable("autoplay", "false");
	if(_type == 1){
		so1.addVariable("config", "http://www.topseos.com/mini_player/skin/config.xml");
	}else if(_type == 2){
	  so1.addVariable("config", "http://www.topseos.com/mini_player/skin/config2.xml");	
	}
	so1.addVariable("flv", _host + 'files/videos/companies/' + _clip);
	so1.addVariable("showarrow", "false");
	so1.addVariable("vimage", _host + 'files/videos/companies/company-video_comingsoon.jpg');
	so1.addVariable("showlayer", "false");
	so1.addParam("wmode","window");
	so1.addParam("allowscriptaccess", "always");
	so1.addVariable("enablejs","true");
	so1.write("mediaspace");
});

function validate_creview_form(){
	var f = $('submit_article_review_form');
	if(f.rtg.value == 0 ){
		alert("Please rate this Company.");
	  return false;
	}else if(f.name.value==""){
	 	alert("Please Enter Your Name.");
	  f.name.focus();
	 	return false;
	}else if(f.title.value==""){
	 	alert("Please Enter Summary.");
	  f.title.focus();
	 	return false;
	}else if(f.description.value==""){
	 	alert("Please Enter Review.");
	  f.description.focus();
	 	return false;
	}else if(f.email.value==""){
	 	alert("Please Enter the Email.");
	  f.email.focus();
	 	return false;
	}else if(!email(f.email.value)){
	  alert("Please Enter Valid Email.");
	  f.email.focus();
	 	return false;
	}else{
		return true;
	}
	return true;
}

function submitReview(){
	location.reload(true);
}

function offensiveFlag(rowid, valid, updateid){
	URL = _host + 'Company/Flag/'+rowid+'/'+valid;
	new Ajax.Request(URL, { 
		method: 'get', 
		onSuccess: function(transport) { 
			$(updateid).update(transport.responseText);
		} 
	});
}

function sendForm(){
	URL = _host + 'Company/saveRating';
	new Ajax.Request(URL, { 
		method: 'post', 
		parameters: Form.serialize($('submit_article_review_form')), 
		onSuccess: function(transport) { 
			//$(updateid).update(transport.responseText);
		} 
	});
	return true;
}