// JavaScript Document

//used in Categories Landing pages 

$(function() {
									 
	var locale = wep.locale;
	var site = odw;
	_gaq.push(['_trackPageview', '/general/ModelPage/'+wep.locale+'/'+model_used]);
	if(model_used!=''){_gaq.push(['_trackPageview', '/Models/'+manMainCat+'/'+manSubCat+'/'+manModel])};
	
///\brief Specific Behaviour for GV-HD700E : product page but just the manual tab



/*If there is no model in the url */		
	
	if(window.location.href.indexOf("&m=") == -1){
		/* if there is only one model, show the page*/
		var optionNr = $('#m option').size();

		if (optionNr <3 ){
			var parentlink = window.location.href.substring(0,'?');
			var model = $('#m option').eq(1).val();
			window.location.href = parentlink + "?site=" + site +'&m=' + model;		
		}; 
		
		/*If there is a model in the url and there is only one model, hide the select box
		+ Extra condition for ie7 that does not recognize the options from inside the kasa frame : don't do this for kasa*/
	}else if (window.location.href.indexOf("&temp=") == -1){if($('#m option').size() <3){$('.model_sel').hide();}
	;}

	
	if (document.referrer.indexOf('/repair/index.aspx')!= -1){
		if($('#tabTitle_5')){		
				activateTab( 5 );
				if(wep.locale == 'en_GB' || wep.locale == 'nl_NL' || wep.locale == 'fr_BE' || wep.locale == 'nl_BE' || wep.locale == 'pl_PL' || wep.locale == 'de_AT' || wep.locale == 'fr_FR' || wep.locale == 'cs_CZ' || wep.locale == 'hu_HU' || wep.locale == 'en_LV' || wep.locale == 'hr_HR' || wep.locale == 'hr_BA' || wep.locale == 'sr_YU' || wep.locale == 'bg_BG' || wep.locale == 'sl_SI' || wep.locale == 'sk_SK' || wep.locale == 'ro_RO'){
					if(window.location.href.indexOf("stg.") == -1) {showSparrow('prod');}else{showSparrow('stg');}
				;}
		}
	}else if (document.referrer.indexOf('/contacts/index.aspx')!= -1){
		if($('#tabTitle_6')){activateTab( 6 );}
	}

	else if (s.prop23=="MAN" || document.referrer.indexOf('/manuals/index.aspx')!= -1|| document.referrer.indexOf('/manuals/manuals.aspx')!= -1){
		if($('#tabTitle_3')){
			getModelManuals( manModel, s.prop3, manMainCat, manSubCat );
			activateTab( 3 );
			}
	}	
	
	else{activateTab( 1 );};

/*End of onload*/

     
 
});

   function sort(){
	   $('#divManTable table').hide();	}
