(function(window, document, undefined) { 
	if (!window.guru) {window.guru = {}; }
	guru.forms = {
		 hideButtonValue : function() {
			jQuery('input[value="Go"]').attr("value", "");
		 }
	 }; 
	
})(window, document);



function splitValue(value, token, index){
    var arr = value.split(token);
    return arr[index];
}

String.prototype.stripSpaces = function( ){ return this.replace( /\s/g, "" ); };

function whiteSpace(value){
    value = value.replace(/^\s*|\s*$/g, '');
    return value;
}

function removeSpaces(string) {
 return string.split(' ').join('');
}

function getParam(name){
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regexS = "[\\?&]" + name + "=([^&#]*)";
    var regex = new RegExp(regexS);
    var result = regex.exec(window.location.href);
    if (result == null) 
        return "";
    else 
        return result[1];
}

function splitValue(value, token, index)
{
	 var arr = value.split(token);
 	 return arr[index];
} 

function popup(url, width, height)
{
	 var params = 'width='+ width;
	 params += ', height='+ height;
	 params += ',menubar=yes';
	 params += ',toolbar=yes';
	 params += ',resizable=yes';
	 window.open(url,"", params);
}

function addCarousel(id, movieLocation, width, height, alt)
{
	var flashvars = {};
	var params = { };
	var attributes = {};
	
	flashvars.xmlpath = escape(jQuery("[id$='"+id+"']").attr("class"));
	flashvars.holdfor = "5";
	params.wmode = "opaque";
	
	var myMovie = movieLocation;
	var expressInstall = "/javascript/swfobject/expressInstall.swf";
	
	swfobject.embedSWF(myMovie, alt, width, height, "9.0.0", expressInstall, flashvars, params, attributes);
}

function attachPopupCode()
{
	jQuery(".shareLink").click( function() {
		popup(jQuery(this).attr("href"), 400, 300);
		return false;
	}); 
}


