added some js to detect ip type and default views