
var conf = { 
    // jquery scrollable (playlist) configuration
    scrollable: {
        size: 4,
        easing: 'linear'
    },


    //Flowplayer config
    // *.opengolf.com
    key: '#@869a443cd1416f1cdb4',
    // default clip configuration 
    clips: {
        defaults: { 
            provider: 'akamai',
            autoPlay: true,
            autoBuffering: true,
            seekableOnBegin: true,
            scaling: 'fit'
        }
    
    },
    plugins: 
    {
        controls: 
        {
            akamai: {
                url: '/styles/Flowplayer/flowplayer.rtmp.swf',
                //url: '/styles/Flowplayer/flowplayer.rtmp-3.2.0.swf', //it really doesn't like this version!
                netConnectionUrl: 'rtmp://cp72366.edgefcs.net/ondemand'
            },
            defaultcontrols:{
                url:'/styles/Flowplayer/flowplayer.controls-3.1.5.swf',
                autoHide: 'always',
                stop: true,
                //playlist: true,
                backgroundColor: 'transparent'
            }
            
        }
    }
   
    
}





function ChangeQueryStringValue(action,qsname,qsvalue)
{
	if (action.indexOf('?') == -1 )	 //If no querystring present
		return (action+"?"+qsname+"="+UrlEncode(qsvalue)); //x.asp?Name=Peter+Paul
	else
	{		
		if ( (action.indexOf("?"+qsname+"=") == -1 ) && (action.indexOf("&"+qsname+"=") == -1 ) ) //Passed querystring not already present		


    		{
    			return (action+"&"+qsname+"="+UrlEncode(qsvalue)); //x.asp?Age=25&Name=Peter+Paul;
    		}
    		else //Passed Querystring already present, replace it no matter if it is ?Name= or &Name=


        		{
        			var replaceQSPrefix=(action.indexOf("?"+qsname+"=")==-1)?"&"+qsname+"=":"?"+qsname+"=";
        			var replaceQSSuffix=""; //This will be John in case of ?Name=John or &Name=John 
        			startpos=action.indexOf(replaceQSPrefix);
        			
        			for (a=(startpos+replaceQSPrefix.length);a<action.length;a++)


            			{
            				if ( action.charAt(a)=='&' ) //Next querystring beginning
            					break;
            				else
            					replaceQSSuffix += action.charAt(a);
            			}
            			newaction=action.replace(replaceQSPrefix+replaceQSSuffix,replaceQSPrefix+UrlEncode(qsvalue));
            			return newaction;
            		}	
            	}		
        }

function UrlEncode(text) 


    {		
    	//text="A.asp?name=Amit Chauhan&Age=25"; //Example
    	
    	/*
    	text=text.replace("/\//g","%2F");
    	text=text.replace("/?/g","%3F");
    	text=text.replace("/=/g","%3D");
    	text=text.replace("/&/g","%26");			
    	*/	
    	
    	//text=ReplaceAll(text, "/\", "%2F"); 
    	text=ReplaceAll(text, "?", "%3F");
    	text=ReplaceAll(text, "=", "%3D");
    	text=ReplaceAll(text, "&", "%26");
    	text=ReplaceAll(text, " ", "+");
    	text=ReplaceAll(text, ",", "%2c");	
    	
    	return text;
}

//Replace all given string from a string
//     
function ReplaceAll(varb, replaceThis, replaceBy)


    {	
    	newvarbarray=varb.split(replaceThis);
    	newvarb=newvarbarray.join(replaceBy);	
    	return newvarb;
}
