// Core V-Button Functions
var vbutton = null;
var vbutton_ex = null;

function check() {
if (vbutton_ex && vbutton_ex.open && !vbutton_ex.closed) vbutton_ex.close();
}

function check_ex() {
if (vbutton && vbutton.open && !vbutton.closed) vbutton.close();
}

function ClipSelectEx(clipid) {
vbutton_ex = window.open('http://vbuttons.com/vbutton.php?clip_id='+clipid+'&ex=1','vbutton_ex','width=370,height=297,resizable=1');
check_ex();
}

function VSelect(parms) {
vbutton = window.open('http://vbuttons.com/vbutton.php?'+parms+'','vbutton','width=285,height=297,resizable=1');
check();
}

function ClipSelect(clipid) {
vbutton = window.open('http://vbuttons.com/vbutton.php?clip_id='+clipid+'','vbutton','width=285,height=297,resizable=1');
check();
}

// Newly added functions
function ems_signup(campid,redirect) {
	window.open('http://vbuttons.com/ems/ems_signup-popup.php?campid='+campid+'&redirect='+redirect,'ems_signup','width=300,height=300,resizable=1');
}

function ClipSelectWide(clipid,height,width) {
	if(width == null) {
		width = 480;
	}
	if(height == null) {
		height = 300;
	}
	window.open('http://vbuttons.com/vbutton.php?clip_id='+clipid+'','vbutton','width='+width+',height='+height+',resizable=1');
}

