$(document).ready( function() {
   
    $('A[class="popup"]').click( function() {
        popUp($(this).attr('href'));
        return false;
    });
    
    $('A[class="external"]').click( function() {
        window.open( $(this).attr('href') );
    });
   
});


function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=900,height=500,left = 410,top = 200');");
}

    
 // For homepage tour video     
      // <![CDATA[
      var args = new Object();
      var query = location.search.substring(1);
      // Get query string
      var pairs = query.split( "," );
      // Break at comma
      for ( var i = 0; i < pairs.length; i++ )
      {
         var pos = pairs[i].indexOf('=');
         if( pos == -1 )
         {
            continue; // Look for "name=value"
         }
         var argname = pairs[i].substring( 0, pos ); // If not found, skip
         var value = pairs[i].substring( pos + 1 ); // Extract the name
         args[argname] = unescape( value ); // Extract the value
      }
      // ]]>
       