﻿/* LOCAL
var pathRoot = 'http://localhost/Nails';
 */
/* TEST
var pathRoot = 'http://beta.nailsmag.com';
 */
/* SERVER */
var pathRoot = 'http://www.nailsmag.com';


var axel = Math.random() + "";
var ord = axel * 1000000000000000000;

function PopUpWindow(page, window_name, window_width, window_height, window_features) {
	window_features = window_features + ", width="+window_width+", height="+window_height;
	//document.CtrlWindow.close;
	OpenWin = window.open(page, window_name, window_features);
}

function PrintPopUp(page)
{
    PopUpWindow(page, 'Print', 700, 600, 'toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes');
}

function NotePopUp(page)
{
    PopUpWindow(page, 'Note', 600, 450, 'toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes');
}

function ArticleImageViewer(image, title)
{
    PopUpWindow(pathRoot+'/Article/ImageViewer.aspx?title='+title+'&image='+image, 'ArticleImage', 950, 685, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}
function ArticleImageViewer(image, channel, title)
{
    PopUpWindow(pathRoot+'/Channel/'+channel+'/Article/ImageViewer.aspx?title='+title+'&image='+image, 'ArticleImage', 950, 685, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function NewsImageViewer(image, title)
{
    PopUpWindow(pathRoot+'/News/ImageViewer.aspx?title='+title+'&image='+image, 'NewsImage', 950, 685, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}
function NewsImageViewer(image, channel, title)
{
    PopUpWindow(pathRoot+'/Channel/'+channel+'/News/ImageViewer.aspx?title='+title+'&image='+image, 'NewsImage', 950, 685, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function ProductImageViewer(image, title)
{
    PopUpWindow(pathRoot+'/Product/ImageViewer.aspx?title='+title+'&image='+image, 'ProductImage', 950, 685, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}
function ProductImageViewer(image, channel, title)
{
    PopUpWindow(pathRoot+'/Channel/'+channel+'/Product/ImageViewer.aspx?title='+title+'&image='+image, 'ProductImage', 950, 685, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function BlogPostImageViewer(image, title)
{
    PopUpWindow(pathRoot+'/Blog/ImageViewer.aspx?title='+title+'&image='+image, 'BlogImage', 950, 685, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function PhotoGalleryImageViewer(galleryID) 
{
    PopUpWindow(pathRoot + '/PhotoGalleries/ImageViewer.aspx?id=' + galleryID, 'PhotoGalleryImage', 950, 685, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}
function PhotoGalleryImageViewer(galleryID, channel) 
{
    PopUpWindow(pathRoot + '/Channel/' + channel + '/PhotoGalleries/ImageViewer.aspx?id=' + galleryID, 'PhotoGalleryImage', 950, 685, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function OpenPageFromPopUp(URL)
{
	if (window.opener && !window.opener.closed)
	{
		window.opener.location = URL;
		window.close();
	}
	else
	{
		window.open(URL);
		window.close();
	}
	window.open(URL);
}