var ShopActionLoginPopup = "LoginPopup"; var ShopActionAcceptTerms = "AcceptTerms"; var ShopActionProceed = "Proceed"; var windowHandlerAdded = false; var popupHandlersAdded = false;
var ControlRegister = { };

function CallVWModalPopup(logolink, shopid, requestedAction, transactionLink) {
    if ($get("logolink"))
        $get("logolink").src = logolink + '?w=150&h=50&bc=ffffff';

    if ($get("HfClickedShop"))
        $get("HfClickedShop").value = shopid;

    // Writing value to hidden field to ensure redirect after login
    // [SC: 11.08.2009]

    if ($get(hfTransactionLinkId)) {
        $get(hfTransactionLinkId).value = transactionLink;
    }

    switch (requestedAction)
    {
        case ShopActionLoginPopup:
        	if (ControlRegister["LoginPopup"])
            	$find(ControlRegister["LoginPopup"]).show();

            break;
        case ShopActionAcceptTerms:
        	if (ControlRegister["AcceptTerms"])
            	$find(ControlRegister["AcceptTerms"]).show();

            break;
        case ShopActionProceed:
            window.open(transactionLink, 'google', '');
            break;
    }
}

// This function can be used to identify the clicked object.
// For that set the identifier to the required value.
// #########################################################
// PreDefined identifiers are: 
// - VW-Shop
// [SC]
function SetClickedObjectIdentifier(identifier) {
    if ($get(HfClickedObjectIdentifierId)) {
        $get(HfClickedObjectIdentifierId).value = identifier;
    }
}