function externalLinks() { 
    if (!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName("a");
    for (var i=0; i<anchors.length; i++) {
        var anchor = anchors[i];
        if (anchor.getAttribute("href") &&
            anchor.getAttribute("rel") == "external")
            anchor.target="_blank";
    }
} 
window.onload = externalLinks;

function clearForm(val,defaultval){
    if(val.value==defaultval){
        val.value="";
    }
}

$(document).ready(function() {				
    /*$("#loginForm").validate({
        rules: {
            'username': {
                required: true
            //email: true
            },
            'password': {
                required: true
            //email: true
            }
        }

    });
		
    $("#registerForm").validate({
        rules: {
            password: {
                required: true,
                minlength:5
            },
            passwdRepeat: {
                equalTo: "#password"
            },
            username:{
                required: true,
                minlength:5,
                maxlength:20
            }
        }

    });
		
    $("#editDetailsForm").validate({
        rules: {
            passwdRepeat: {
                equalTo: "#password"
            },
            username:{
                required: true,
                minlength:5,
                maxlength:20
            }
        }

    });
    $("#passwordForm").validate();
		
    $("#editPasswordForm").validate({
        rules: {
            password: {
                required: true,
                minlength:5
            },
            new_password: {
                required: true,
                minlength:5
            },
            new_password2: {
                equalTo: "#new_password"
            }
        }
    });
    $("#checkoutForm").validate();
    $("#enterForm").validate();
    $("a[rel='lightbox']").colorbox();

    $('.wine_off').qtip({
      content: {
         text: "Wine Offer participant"
      },
      style: 'dark' // Give it some style
      
   });*/

    $("a[rel='lightbox']").colorbox();
    $("#nominateForm3").validate();
		
});
