
window.isIE=(window.navigator.userAgent.indexOf("MSIE")!=-1)||false;var gearsutil={};function detectPlugins(){if(typeof(navigator.plugins)!='undefined'){for(var i=0;i<navigator.plugins.length;i++){var plugin=navigator.plugins[i];var name=plugin.name;console.log(name);}}}
function addConsoleDebug(){if(/__debug__$/i.test(document.location.href)){if(!window.console){window.console={};window.console.log=function(message){var divId='v_window_console';var consoleDiv=document.getElementById(divId);if(!consoleDiv){var consoleDiv=document.createElement('div');consoleDiv.id=divId;consoleDiv.style.position='absolute';consoleDiv.style.top='0';consoleDiv.style.right='0';consoleDiv.onclick=function(){consoleDiv.innerHTML='';};document.body.appendChild(consoleDiv);}
messageDiv=document.createElement('div');messageDiv.innerHTML=message;consoleDiv.appendChild(messageDiv);}}}else{window.console=window.console||{};window.console.log=function(message){};}}
function props(obj){for(name in obj){console.log(name+' = '+obj[name]);}}
if(!Array.indexOf){Array.prototype.indexOf=function(arg){var index=-1;for(var i=0;i<this.length;i++){var value=this[i];if(value==arg){index=i;break;}}
return index;}}
function scriptLoad(url,callback){var script=document.createElement('script');script.src=url;var heads=document.getElementsByTagName('head');if(heads.length>0){head=heads[0];head.appendChild(script);}else{head=document.createElement('head');head.appendChild(script);document.body.parentNode.appendChild(head);}
script.onload=callback;script.onreadystatechange=function(){if(script.readyState=='loaded'||script.readyState=='complete'){callback();}};}
gearsutil.isGearsInstalled=function(){if(window.google&&google.gears){return true;}
var factory=null;if(typeof GearsFactory!='undefined'){factory=new GearsFactory();}else{try{factory=new ActiveXObject('Gears.Factory');}catch(e){if(navigator.mimeTypes["application/x-googlegears"]){factory=document.createElement("object");factory.style.display="none";factory.width=0;factory.height=0;factory.type="application/x-googlegears";document.documentElement.appendChild(factory);}}}
if(!factory){return false;}
if(!window.google){window.google={};}
if(!google.gears){google.gears={factory:factory};}
return true;};gearsutil.getGearsInstallURL=function(msg){return"http://gears.google.com/?action=install&message="+
msg+'&return='+document.location.href;};gearsutil.defaultNoGears=function(msg){var installUrl=gearsutil.getGearsInstallURL(msg);var html='Sorry, this site requires the use of '+'<a href="http://code.google.com/apis/gears/">Google Gears</a>.<br><br>'+'Do you want to install Google Gears?&nbsp;&nbsp;';var div=document.createElement('div');div.innerHTML=html;var installButton=document.createElement('input');installButton.type='button';installButton.value='install';installButton.onclick=function(){document.location.href=installUrl;};div.appendChild(installButton);document.body.innerHTML='';document.body.appendChild(div);};gearsutil.defaultNoPermission=function(msg){var html='Sorry, this site requires the use of '+'<a href="http://code.google.com/apis/gears/">Google Gears</a>.'+'<br><br>Do you want to grant the use of Google Gears API?&nbsp;&nbsp;';var div=document.createElement('div');div.innerHTML=html;var button=document.createElement('input');button.type='button';button.value='grant';button.onclick=function(){document.location.href=document.location.href;};div.appendChild(button);document.body.innerHTML='';document.body.appendChild(div);};gearsutil.requestGearsForLocation=function(msg){var success=false;if(gearsutil.isGearsInstalled()){success=google.gears.factory.create('beta.geolocation').getPermission(msg);}
return success;};gearsutil.requestGearsForLocalStorage=function(msg){var success=false;if(gearsutil.isGearsInstalled()){success=google.gears.factory.getPermission(msg);}
return success;};