function set_cookie() {

    var cookie_string = "js_enabled=1";
    var cookie_exists = "no";
    var expdate = new Date();
    
    expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000));
    
    var cookies = document.cookie.split(';');
    
    for(var i=0;i < cookies.length;i++)
    {
    	var current_cookie = cookies[i];
    	
    	if( current_cookie.match(cookie_string) ) { 
    		cookie_exists = 'yes';
    		break;
    	}
    }

 //   alert(cookie_exists);    
 
    if (cookie_exists == "no"){

        document.cookie = "js_enabled=1; path=/; expires=" + expdate.toGMTString();

//        var querystring = location.search.substring(0);
        
//        if( !querystring.match(/_c=1/) ) {
//        	alert( querystring );
//        	if( querystring.charAt(0) == '?' ) {
//        		document.location = location.href + '&_c=1';
//        	}
//        	else {
//        		document.location = location.href + '?_c=1';
//        	}
//        }
        
    }

}

