function clearfields(standard, field)
{

	element = document.getElementById(field);
	if(element.value == standard || element.value == "")
	{
		element.value = "";	
	}
	
}


// select by mouseclick - all browsers
function select_OnClick(fld)
{
    var sUrl = fld.options[fld.selectedIndex].value;
    if (sUrl != "" && sUrl != 1 && sUrl != 2)
    {
  fld.selectedIndex = 0; // reset if the user uses 'back'
        location = sUrl;
    }
}

// function for ie 4+ and netscape 6+
function select_OnKeyUp(fld, evt)
{
    var sUrl = fld.options[fld.selectedIndex].value;
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0));
    if (charCode == 13)
    {
        if (sUrl != "" && sUrl != 1 && sUrl != 2)
        {
            fld.selectedIndex = 0; // reset if the user uses 'back'
            location = sUrl;
        }
    }
}

// function for netscape 4.x
function select_OnChange(fld, event) {
    var sUrl = fld.options[fld.selectedIndex].value;

    if (navigator.vendor) // check for safari/chrome
    {
        var safari = navigator.vendor.indexOf('Apple') == 0;
        var chrome = navigator.vendor.indexOf('Google Inc.') == 0;
        if (safari || chrome) {

            if (sUrl != "") {
                location = sUrl;
            }
        }
    }
}

$('#imageplayer').cycle({
    fx:     'fade',
    speed:  1250,
    timeout: 5000,
    next:   '#next',
    prev:   '#prev',
    pause:	1
});

function openPictureWindow(url,width,height,left,top) {
    
    if (!height)
        height = screen.height * 0.7;
    if (!width)
        width = 'auto';
    if (!left)
        left = (screen.width - width) / 2;
    if (!top)
        top = ((screen.height - height) / 2) - 30;

    w = window.open(url, 'PictureViewWindow', 'location=no,scrollbars=yes,menubar=yes,toolbar=yes,resizable=yes,left=' + left + ' ,top=' + top + ' ,width=' + width + ' ,height=' + height);
    w.focus();
}
