how to set $default store id or default website in magento
how can I set the default store or website in magento at a global level. If I am already in a magento website then I can set the default store for that website however I want to set it at a global level above that. I have a geoip api and using this I want to set which website is default depending on where the customer is coming from I have tried to use getDefaultStore() but this seems to only be useable if I already know which website we are in 
how to set $default store id or default website in magento
===

how can I set the default store or website in magento at a global level. If I am already in a magento website then I can set the default store for that website however I want to set it at a global level above that. I have a geoip api and using this I want to set which website is default depending on where the customer is coming from I have tried to use getDefaultStore() but this seems to only be useable if I already know which website we are in 