jQuery(document).ready(function(){

	if(getParameterByName('lang') == 'id'){
        //$("link").attr("href",'wp-content/themes/neoclassical/style_ind.css');
        jQuery('head').append('<link rel="stylesheet" href="wp-content/themes/neoclassical/style_ind.css" type="text/css" />');
		jQuery('#searchbox .blurb').html('Untuk mencari silahkan ketik katakunci di bawah ini dan kemudian tekan enter');
		jQuery('#subscribe .blurb').html('Untuk subscribe silahkan ketik alamat email anda di bawah ini dan tekan submit');
		jQuery('#subscribe .blurb').css('margin-top','50px');
		jQuery('.result a.submitLarge').html('Klik untuk melihat');
		jQuery('fieldset#searchLibrary input.submitBtn').val('Kirimkan');
		jQuery('#subscriptionReturnUrl').val('http://www.oilpalm-biodiversity.info/?page_id=547&lang=id');
		jQuery('input.contactsubmit').val('Kirim');
		jQuery('input.subscribeButton').css('background-image','url(http://www.oilpalm-biodiversity.info/wp-content/themes/neoclassical/images/kirim_small.jpg)');
		jQuery('.searchfail p').html('silahkan coba lagi.');
		jQuery('label[for="si_contact_name"]').html('Nama:');		
		jQuery('label[for="si_contact_email"]').html('Alamat email:');	
		jQuery('label[for="si_contact_subject"]').html('Subyek:');
		jQuery('label[for="si_contact_message"]').html('Pesan:');
		jQuery('h1.searchfail').html('Kami tidak bisa menemukan itu...');
		Cufon.replace('h1', { fontFamily: 'Harabara', color: '#ff6600' });

		//return false;
	}
    //});



//$("#lang_en").click(function() {
	//var styleSheets = document.styleSheets;
//var href = 'wp-content/themes/neoclassical/style_ind.css';
//for (var i = 0; i < styleSheets.length; i++) {
//    if (styleSheets[i].href == href) {
//        styleSheets[i].disabled = true;
//        break;
//    }
//}

if(getParameterByName('lang') == ''){
jQuery("LINK[href='wp-content/themes/neoclassical/style_ind.css']").remove();
}
//return false;
//});




 function getParameterByName(name)
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}
 


//If its a page parent (based off wordpress), add the class "displayMe"
//This way the accordion will be opened up on the page you are on.

//Hide the submenus
jQuery('ul li ul').hide();

//Add a class to the parent li IF it has sub UL's
jQuery("ul li:has(ul)").addClass("theDon");

//Da henchman
jQuery("ul li ul li:has(a)").addClass("henchmen");

//Remove the link if it has a submenu
jQuery('.theDon > a').attr('href', '#');

//When you click it, toggle bitch.
jQuery('ul li a').click(
function() {

//Onclick Remove the class dipslay me which is only display:block;
//This way they can close it if they click it or it will glitch
jQuery(this).next().slideToggle('fast').removeClass("displayMe");

//return false so the # doenst move view to the top of the page
if (jQuery(this).attr('href') == '#') { return false; }

//Close it all out
	});

 

});



