function ee(str_id){
	
	return document.getElementById(str_id);
}
	
function onRollOver(obj_img){
	obj_img.src = obj_img.src.split("-off").join("-on");
}

function onRollOut(obj_img){
	obj_img.src = obj_img.src.split("-on").join("-off");
}

var str_last_active_pictorial = "";
function turnOnActivePictorial(id) {
		//alert(str_last_active_pictorial);
	
	if(ee(str_last_active_pictorial)) {
		ee(str_last_active_pictorial).style.visibility="hidden";
		ee(str_last_active_pictorial + "-tab").className="pictorial-tab-off";
	}
	
	if(ee(id)) {
		ee(id).style.visibility="visible";
		
		if(ee(id + "-tab")) {
			ee(id + "-tab").className="pictorial-tab-on";
		}
		str_last_active_pictorial = id;
	}
}	

	
	
function onHeadingSize__astojs(int_width,int_height,str_div_id){
	
	if (ee(str_div_id)){ 
		 
		ee(str_div_id).style.width = String(int_width) + "px";
		ee(str_div_id).style.height = String(int_height) + "px";
		
	}  
}

function replaceHeading(obj_heading, str_basehref){
		
		if (!obj_heading){
			return
		}

		var str_heading = obj_heading.innerHTML;
		
		str_heading = str_heading.split("&amp;").join("&");
		
		str_heading = str_heading.split("&").join("__amp__");  
		str_heading = str_heading.split("\"").join("__dq__");
		str_heading = str_heading.split("'").join("__sq__");
		str_heading = str_heading.split("?").join("__q__");
		str_heading = str_heading.split("%").join("__per__");									
		
		var so_heading = new SWFObject(str_basehref + "h1.swf", "flash_" + obj_heading.id, "100%", "34", "8");	
		
		so_heading.addParam("wmode","transparent"); 									
		
		//alert("???" + str_heading)
		
		so_heading.addVariable("str_heading", str_heading);
		so_heading.addVariable("str_uniqid", obj_heading.id);
		
		so_heading.write(obj_heading.id);   
		
			
}

/*--------------------------- POPUP IMAGE STYLE ----------------------------*/

function launchPopupWindow(id) {
	if (ee("popup_window" + id)) {
		ee("popup_window" + id).style.display="block";
		
		if (ee("image_popover_container" + id)) {
			ee("image_popover_container" + id).style.zIndex="9999";
		}
	}
}

function closePopupWindow(id) {
	if (ee("popup_window" + id)) {
		ee("popup_window" + id).style.display="none";
		
		if (ee("image_popover_container" + id)) {
			ee("image_popover_container" + id).style.zIndex="9";
		}
	}
}

function launchTermsConditions(id) {
	if (ee("popup_iframe" + id)) {
		
	}	
}

function getContentFromIframe(iFrameName)  
 {  
  
    var myIFrame = document.getElementById(iFrameName);  
     var content = myIFrame.contentWindow.document.body.innerHTML;  
  
   // alert(content);
	//Do whatever you need with the content      
   
} 

function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
	var pair = vars[i].split("=");
	if (pair[0] == variable) {
	  return pair[1];
	}
  } 
}


// EG.
/*if (getQueryVariable("show_seq") != "1"	){
	selectTab(1);
}*/



/*-------------- TESTIMONIALS WIDGET ---------------------*/

var str_previous_testimonial = "";
var int_current_testimonial_num = 0;

function displayNextTestimonial(){

	setTestimonialNum(int_current_testimonial_num+1);	
}

function displayPrevTestimonial(){
	
	setTestimonialNum(int_current_testimonial_num-1);	
}

function setTestimonialNum(int_new_num){
	
	
	if (int_new_num < 1 ){
		int_new_num = int_total_testimonial_items;
	}
	
	if (int_new_num > int_total_testimonial_items){
		int_new_num = 1;
	}
	
	if (int_current_testimonial_num == int_new_num ){
		return;
	}
	
	var int_old_testimonial_num = int_current_testimonial_num;
	int_current_testimonial_num = int_new_num;
	

	if (typeof(window["stopFLVByStopId"+ String(int_old_testimonial_num)]) != "undefined"){
		eval("stopFLVByStopId"+ String(int_old_testimonial_num)+"()");
	}
	
	if (ee('testimonial_item' + int_old_testimonial_num)) {
		
		ee('testimonial_item' + int_old_testimonial_num).style.display="none";
	}
	if (ee('testimonial_item' + int_current_testimonial_num)) {	
		ee('testimonial_item' + int_current_testimonial_num).style.display="block";
	}		
}



