// JavaScript Document

if (!window.console || !console.firebug)
{
    var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
    "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];

    window.console = {};
    for (var i = 0; i < names.length; ++i)
        window.console[names[i]] = function() {}
}


$(document).ready(function(){
		$(document).pngFix();
		//set cookie on click of contact links
		$('.contact-link').click(function(){
			$.cookie('contact', $(this).attr('rel') );
		})
		
		//if on contact page, set contact dropdown corresponding to cookie
		if( $('body').is('.contact') )
		{
			$('div.contactform .zmok-members option').each(function(){
				
				if( $.cookie('contact') == $(this).val() )
				{
					console.log("options match", $.cookie('contact'), $(this).val() );
					$('div.contactform .zmok-members select option:eq(0)').attr('selected', '');
					$(this).attr('selected', 'selected');
					return;
				}else{
					$('div.contactform .zmok-members select optioneq(0)').attr('selected', 'selected');
				}
			})
		}
});