
function popwinnew(loc,winname,w,h,scroll,resize) {
	eval('var newwin = window.open("' + loc + '","' + winname + '","width=' + w + ',height=' + h + ',top=100,left=200,location=no,scrollbars=' + scroll + ',menubar=no,toolbar=no,resizable=' + resize + '")');
}


function popwin(page) {
	windowprops = "width=400,height=400,location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=yes";
	thewin = window.open(page, "popup", windowprops);
}


function popreg(page) {
	windowprops = "width=750,height=500,location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=yes";
	thewin = window.open(page, "Registration Form", windowprops);
}


function popwin2(page) {
	windowprops = "width=800,height=600,location=no,scrollbars=yes,menubars=yes,toolbars=no,resizable=yes";
	thewin = window.open(page, "popup2", windowprops);
}

function popwin3(page) {
	windowprops = "width=350,height=400,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no";
	thewin = window.open(page, "popup3", windowprops);
}

function popwin4(page) {
	windowprops = "width=400,height=400,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no";
	thewin = window.open(page, "popup4", windowprops);
}

function popsch(page) {
	windowprops = "width=350,height=250,location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=yes";
	thewin = window.open(page, "popup", windowprops);
}


function RideWindow() {
	popwinnew('http://www.harley-davidson.com/wcm/Content/Pages/Ride_Planner/Ride_Planner.jsp?locale=en_US','RidePlanner',1050,600,'yes','yes');
}


function popgallery(loc,winname,w,h,scroll,resize) {
	eval('var newwin = window.open("' + loc + '","' + winname + '","width=' + w + ',height=' + h + ',top=100,left=200,location=no,scrollbars=' + scroll + ',menubar=no,toolbar=no,resizable=' + resize + '")');
}

/****************************************************************
pop-up window functionality
*****************************************************************/

window.onerror=null;
var win = null;

function NewWindow(mypage, myname, w, h, scroll) {
closePopWin();

var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',noresize';
if( mypage.indexOf("bmLocale") < 0 ) {
    if( mypage.indexOf("?") < 0 ) {
      mypage = mypage + "?";
    }
    else {
      mypage = mypage + "&";
    }
    mypage = mypage + "bmLocale=en_US";
}

win = window.open(mypage, myname, winprops);
//if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function NewIntLoginWindow(mypage, myname, w, h, scroll) {
closePopWin();

var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',noresize';

win = window.open(mypage, myname, winprops);
//if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function closePopWin() {
	if(win != null) {
		if(!win.closed) {
			win.close();
			win = null;
		} else {
			win = null;
		}
	}
}

function LocatorWindow( paramString ) {  //--change all vicinity links to 598 wide after wrapping is fixed
var vURL;

   vURL = "http://www.harley-davidson.com/DE/LOC/en/DealerLocator.asp?LL=en_us&AD4=USA";
   //vURL = "http://go.vicinity.com/harleyintld/prxStart.dsp?LL=en_us&AD4=USA";

   NewWindow(vURL, '', 620, 500, 'yes');

}

				
