﻿jQuery(document).ready(function(){

        $('.prod_add').click(function(e) {
            e.preventDefault();
            var $this = $(this);
            var horizontalPadding = 30;
            var verticalPadding = 30;
            $('<iframe frameborder="0" id="externalSite" class="externalSite" src="https://www.wpc-edi.com/store/searchresult.aspx?categoryid=' + $this.attr('storeid') + '" />').dialog({
                title: 'Shopping Cart',
                autoOpen: true,
                width: 620,
                height: 540,
                modal: true,
                resizable: false,
                autoResize: true,
				closeText: 'Continue Shopping',
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(620 - horizontalPadding).height(540 - verticalPadding);
        });
        
        $('.help').click(function(e) {
            e.preventDefault();
            var $this = $(this);
            var horizontalPadding = 30;
            var verticalPadding = 30;
            $('<iframe frameborder="0" id="externalSite" class="externalSite" src="index.php?option=com_content&view=article&id=' + $this.attr('articleID') + '&Itemid=' + $this.attr('menuID') + $this.attr('helptype') + '" />').dialog({
                title: $this.attr('title'),
                autoOpen: true,
                width: 640,
                height: 575,
                modal: true,
                resizable: false,
                autoResize: true,
				closeText: '',
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(640 - horizontalPadding).height(575 - verticalPadding);
        });

     $('.helpwide').click(function(e) {
            e.preventDefault();
            var $this = $(this);
            var horizontalPadding = 30;
            var verticalPadding = 30;
            $('<iframe frameborder="0" id="externalSite" class="externalSite" src="index.php?option=com_content&view=article&id=' + $this.attr('articleID') + '&Itemid=' + $this.attr('menuID') + $this.attr('helptype') + '" />').dialog({
                title: $this.attr('title'),
                autoOpen: true,
                width: 800,
                height: 540,
                modal: true,
                resizable: true,
                autoResize: true,
				closeText: '',
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(800 - horizontalPadding).height(540 - verticalPadding);            
        });

        $('.prod_add1').click(function(e) {
            e.preventDefault();
            var $this = $(this);
            var horizontalPadding = 30;
            var verticalPadding = 30;
             $('<iframe frameborder="0" id="externalSite" class="externalSite" src="https://www.wpc-edi.com/store/detail.aspx?ID=' + $this.attr('storeid') + '" />').dialog({
                title: 'Shopping Cart',
                autoOpen: true,
                width: 620,
                height: 540,
                modal: true,
                resizable: false,
                autoResize: true,
				closeText: 'Continue Shopping',
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(620 - horizontalPadding).height(540 - verticalPadding);
        });
        

        $('.prod_add2').click(function(e) {
            e.preventDefault();
            var $this = $(this);
            var horizontalPadding = 30;
            var verticalPadding = 30;
             $('<iframe frameborder="0" id="externalSite" class="externalSite" src="https://www.wpc-edi.com/store/detail.aspx?ID=' + $this.attr('storeid') + '" />').dialog({
                title: 'Shopping Cart',
                closeText: 'Continue Shopping',
                autoOpen: true,
                width: 620,
                height: 540,
                modal: true,
                resizable: false,
                autoResize: true,
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(620 - horizontalPadding).height(540 - verticalPadding);
        });

        $('.prod_add3').click(function(e) {
            e.preventDefault();
            var $this = $(this);
            var horizontalPadding = 30;
            var verticalPadding = 30;
             $('<iframe frameborder="0" id="externalSite" class="externalSite" src="https://www.wpc-edi.com/store/detail.aspx?ID=' + $this.attr('storeid') + '" />').dialog({
                title: 'Shopping Cart',
                closeText: 'Continue Shopping',
                autoOpen: true,
                width: 620,
                height: 540,
                modal: true,
                resizable: false,
                autoResize: true,
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(620 - horizontalPadding).height(540 - verticalPadding);
        });

        $('.prod_wedi_principles').click(function(e) {
            e.preventDefault();
            var $this = $(this);
            var horizontalPadding = 30;
            var verticalPadding = 30;
            $('<iframe frameborder="0" id="externalSite" class="externalSite" src="https://www.wpc-edi.com/store/detail.aspx?ID=1027" />').dialog({
                title: $this.attr('helptype'),
                autoOpen: true,
                width: 640,
                height: 575,
                modal: true,
                resizable: false,
                autoResize: true,
				closeText: '',
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(640 - horizontalPadding).height(575 - verticalPadding);
        });

        $('.prod_wedi_principles_2').click(function(e) {
            e.preventDefault();
            var $this = $(this);
            var horizontalPadding = 30;
            var verticalPadding = 30;
            $('<iframe frameborder="0" id="externalSite" class="externalSite" src="https://www.wpc-edi.com/store/detail.aspx?ID=1335" />').dialog({
                title: $this.attr('helptype'),
                autoOpen: true,
                width: 640,
                height: 575,
                modal: true,
                resizable: false,
                autoResize: true,
				closeText: '',
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(640 - horizontalPadding).height(575 - verticalPadding);
        });

        $('.prod_wedi_template_1').click(function(e) {
            e.preventDefault();
            var $this = $(this);
            var horizontalPadding = 30;
            var verticalPadding = 30;
            $('<iframe frameborder="0" id="externalSite" class="externalSite" src="https://www.wpc-edi.com/store/detail.aspx?ID=1028" />').dialog({
                title: $this.attr('helptype'),
                autoOpen: true,
                width: 640,
                height: 575,
                modal: true,
                resizable: false,
                autoResize: true,
				closeText: '',
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(640 - horizontalPadding).height(575 - verticalPadding);
        });

        $('.prod_wedi_template_2').click(function(e) {
            e.preventDefault();
            var $this = $(this);
            var horizontalPadding = 30;
            var verticalPadding = 30;
            $('<iframe frameborder="0" id="externalSite" class="externalSite" src="https://www.wpc-edi.com/store/detail.aspx?ID=1336" />').dialog({
                title: $this.attr('helptype'),
                autoOpen: true,
                width: 640,
                height: 575,
                modal: true,
                resizable: false,
                autoResize: true,
				closeText: '',
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(640 - horizontalPadding).height(575 - verticalPadding);
        });

        $('.preview').click(function(e) {
            e.preventDefault();
            var horizontalPadding = 30;
            var verticalPadding = 30;
            $('<iframe frameborder="0" id="externalSite" class="externalSite" src="https://www.wpc-edi.com/store/searchresult.aspx?categoryid=' + $(this).next().children('.prod_add').attr('storeid') + '" />').dialog({
                title: 'Shopping Cart',
                autoOpen: true,
                width: 620,
                height: 540,
                modal: true,
                resizable: false,
                autoResize: true,
				closeText: 'Continue Shopping',
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(620 - horizontalPadding).height(540 - verticalPadding);
        });
		
        $('.preview1').click(function(e) {
            e.preventDefault();
            var horizontalPadding = 30;
            var verticalPadding = 30;
            $('<iframe frameborder="0" id="externalSite" class="externalSite" src="https://www.wpc-edi.com/store/detail.aspx?ID=' + $(this).next().children('.prod_add2').attr('storeid') + '" />').dialog({
                title: 'Shopping Cart',
                autoOpen: true,
                width: 620,
                height: 540,
                modal: true,
                resizable: false,
                autoResize: true,
				closeText: 'Continue Shopping',
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(620 - horizontalPadding).height(540 - verticalPadding);
        });

     $('.storeopen').click(function(e) {
            e.preventDefault();
            var $this = $(this);
            var horizontalPadding = 30;
            var verticalPadding = 30;
            $('<iframe frameborder="0" id="externalSite" class="externalSite" src="https://www.wpc-edi.com/store/' + $this.attr('link') + '" />').dialog({
                title: 'Shopping Cart',
                autoOpen: true,
                width: 620,
                height: 540,
                modal: true,
                resizable: false,
                autoResize: true,
				closeText: 'Continue Shopping',
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(620 - horizontalPadding).height(540 - verticalPadding);            
        });


	$('.changesummary').click(function(e) {
            e.preventDefault();
            var $this = $(this);
            var horizontalPadding = 30;
            var verticalPadding = 30;
            $('<iframe frameborder="0" id="externalSite" class="externalSite" src="http://forums.x12.org/' + $this.attr('link') + '" />').dialog({
                title: '006020' + $this.attr('title') + ' Change Summary',
                autoOpen: true,
                width: 620,
                height: 540,
                modal: true,
                resizable: false,
                autoResize: true,
				closeText: '',
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(620 - horizontalPadding).height(540 - verticalPadding);            
        });
		
	$('.window').click(function(e) {
            e.preventDefault();
            var $this = $(this);
            var horizontalPadding = 30;
            var verticalPadding = 30;
            $('<iframe frameborder="0" id="externalSite" class="externalSite" src="' + $this.attr('link') + '" />').dialog({
                title: $this.attr('title'),
                autoOpen: true,
                width: 620,
                height: 540,
                modal: true,
                resizable: false,
                autoResize: true,
				closeText: '',
                overlay: {
                    opacity: 0.5,
                    background: "black"
                }
            }).width(620 - horizontalPadding).height(540 - verticalPadding);            
        });
    });
